.live()绑定是否适用于IE7中的jQuery? [英] Does .live() binding work for jQuery in IE7?
本文介绍了.live()绑定是否适用于IE7中的jQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一段javascript,它应该锁定在通过XHR引入的表单上。它看起来像:
I have a piece of javascript which is supposed to latch onto a form which gets introduced via XHR. It looks something like:
$(document).ready(function() {
$('#myform').live('submit', function() {
$(foo).appendTo('#myform');
$(this).ajaxSubmit(function() {
alert("HelloWorld");
});
return false;
});
});
这种情况适用于FF3,但不适用于IE7。知道问题是什么吗?
This happens to work in FF3, but not in IE7. Any idea what the problem is?
推荐答案
你是如何排除提交的?您可以试试吗?
How are you excuting the submit? Can you try this instead?
$(':submit').live('click', function(e) {
$(foo).appendTo('#myform');
$('#myform').ajaxSubmit(function() {
alert('Hello World');
});
e.preventDefault();
return false;
});
这篇关于.live()绑定是否适用于IE7中的jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文