jQuery live() 和 Internet Explorer

发布于 2024-09-13 11:14:23 字数 400 浏览 4 评论 0 原文

将选择输入动态添加到表单中

$(selector).append(html)

我通过使用 live('change',handler) 为所有选择绑定更改事件, 。问题是代码在所有浏览器中都正常,除了 Internet Explorer(所有版本)。

我已经用插件 livequery() 替换了 live(),该插件仍然在所有浏览器中工作,并且我在 Internet Explorer 中出现了奇怪的行为。

有人可以告诉我将事件绑定到页面加载完成后将创建的元素的正确方法吗?

如果您知道一些用于跟踪 Ajax 请求的良好调试工具(Internet Explorer)。

谢谢。微软让生活变得更加困难。

I have select inputs dynamically added to form by

$(selector).append(html)

I'm using live('change',handler) to bind change event for all selects. The problem is that code is fine in all browser, except Internet Explorer (all versions).

I've replaced live() with the plugin livequery() still working in all browser and i have strange behaviors in Internet Explorer.

Could someone tell me the right way to bind events to elements that will be created after page has finished loading?

And if you know some good debugging tool for tracking Ajax requests (Internet Explorer).

Thans. Microsoft for makes life harder.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怕倦 2024-09-20 11:14:27

这听起来好像您仍在使用 1.4.2 之前版本的 jQuery,如果您升级到 jQuery1.4.2 版本 你的问题应该消失。

1.4.2 包含一个事件模块重写,解决了 change 中的冒泡问题IE

This sounds like you're still using a pre-1.4.2 release of jQuery, if you upgrade to the jQuery1.4.2 release your problems should go away.

1.4.2 included an events module re-write that resolved the change bubbling issue in IE.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文