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();
});
精彩评论