jQuery Form .live在Firefox中提交事件

时间:2022-11-07 13:30:02

I've got some jQuery 1.4.4 code

我有一些jQuery 1.4.4代码

$('.AJAXForm').live('submit', function (e) { .... });

that's working fine in IE but not in Firefox. I'm loading the forms into divs on $(document).ready(...) with

这在IE中运行良好,但在Firefox中运行不正常。我正在将表单加载到$(document).ready(...)上的div中

$('#DivPlaceHolderName').load('URLName .AJAXPageSection');

so that it loads just the section of the target page containing the form object (so that the target form pages also function standalone, in case scripting isn't enabled) but the .live function isn't binding to the form objects when it runs in Firefox. I've tried manually putting an equivalent form on the page itself and it runs the code fine, but the live aspect doesn't seem to work when the forms are subsequently loaded. This works fine with a link (a separate, but similar set of code) and also in Opera, so I'm guessing it's a Firefox issue with the 'submit' event? If so, is there a workaround for FF?

这样它只加载包含表单对象的目标页面的部分(以便目标表单页面也可以独立运行,以防脚本未启用)但.live函数在运行时不绑定到表单对象在Firefox中。我已经尝试手动在页面本身上放置一个等效的表单,它运行代码很好,但是当后续加载表单时,实时方面似乎不起作用。这与链接(一组单独的,但类似的代码)和Opera中的工作正常,所以我猜这是'提交'事件的Firefox问题?如果是这样,FF有解决方法吗?

Thx

谢谢

MH

MH

1 个解决方案

#1


0  

jQuery has been significantly improved since 1.4.4. I'd try The latest version of jQuery (1.6.2 as of this post) to see if the issue has been fixed in the source.

自1.4.4以来,jQuery得到了显着改进。我将尝试最新版本的jQuery(截至本文的1.6.2),以查看问题是否已在源代码中修复。

#1


0  

jQuery has been significantly improved since 1.4.4. I'd try The latest version of jQuery (1.6.2 as of this post) to see if the issue has been fixed in the source.

自1.4.4以来,jQuery得到了显着改进。我将尝试最新版本的jQuery(截至本文的1.6.2),以查看问题是否已在源代码中修复。