开发者

DOM ready twice

I use jQuery on my website and I have a bug on one page.

I submit a form when the DOM is ready like this:

jQuery.(document).ready(function() {
     alert("test"); jQuery("#form").submit(); 
});

My form is like this:

<form id="form" onsubmit="return false;" a开发者_如何转开发ction="test.php"></form>

But when I load my page, the alert appeared twice. So the big problem is the form which submit twice.

Why the dom is loaded twice? This bug is only on IE (all version)

Thanks


$(document).ready(function() {
     alert("test"); 
     $("#form").submit(); 
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜