document.getElementById(" tweetform")。s​​ubmit不是函数? [英] document.getElementById("tweetform").submit is not a function?

查看:95
本文介绍了document.getElementById(" tweetform")。s​​ubmit不是函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firefox并且我一直在阅读一些论坛,声称这在Firefox中不起作用,但它在过去几天一直在为我工作,但已停止工作,我无法弄清楚原因。

I'm using Firefox and I've been reading some forums claiming this doesn't work in firefox but it has been working for me for the last few days but has stopped working and I can not figure out why.

我使用IFrame制作AXAX POST请求。当我收到回复时,我使用它:

I make a AXAX POST Request using an IFrame. When I get the response I use this:

function startLoad(){
    $.get("update.php", function(data){
            if(data==''){
                startLoad();
            }
            else{
                document.getElementById("tweetform").submit();
            }
    });
}

但是,从firebug,我得到了这个:

However, from firebug, I get this:

document.getElementById("tweetform").submit is not a function
[Break on this error] document.getElementById("tweetform").submit();

我知道提交存在,但是发生了什么?

I know submit exists, but what is going on?

推荐答案

我的猜测会在表单中有一个名为submit的元素(可能是< ;按钮> < input type =submit> ,而.submit正在检索对该元素的引用,而不是比如成员函数submit()。如果是这种情况,请尝试将该元素重命名为其他内容(例如,submit_button)。

My guess would be that you have an element in the form that is called "submit" (possibly a <button> or <input type="submit">, and that ".submit" is retrieving a reference to that element, rather than the member function "submit()". If this is the case, try renaming that element to something else (e.g., "submit_button").

这篇关于document.getElementById(&quot; tweetform&quot;)。s​​ubmit不是函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆