Opera 10.6 中的 jQuery.load 未触发完成

发布于 2024-09-16 17:02:58 字数 473 浏览 2 评论 0原文

Opera 是唯一一个对这个 jQuery 语句产生问题的浏览器:

$("select").load("options.html",function() { $(this).val("de"); });

SELECT 不填充任何选项。它是空白的。更糟糕的是,我可以打开 DragonFly 来追踪它,问题就消失了。选项按其应有的方式显示。

有人遇到过这个吗?

HTML 按要求:

<select class="ui-widget-content ui-corner-all">
     <option value="en">English</option>
     <option value="de">Deutsch</option>
</select>

显然,选项不存在开始...

Opera is the only browser giving trouble with this jQuery statement:

$("select").load("options.html",function() { $(this).val("de"); });

The SELECT does not fill with ANY options. It is blank. Worse, I can turn on DragonFly in an effort to trace it down, and the problem disappears. The options are displayed as they should.

Anyone come across this?

HTML as requested:

<select class="ui-widget-content ui-corner-all">
     <option value="en">English</option>
     <option value="de">Deutsch</option>
</select>

Obviously, the OPTIONs aren't there to start with...

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

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

发布评论

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

评论(1

未央 2024-09-23 17:02:58

重复上面的评论:通过将 .load 调用进一步移到 $.ready 函数内的指令列表中,问题得到了解决。这不是我第一次注意到 Opera 的 JS 引擎似乎有点超前了。看起来 DOM-ready 在一切真正准备好之前就被触发了。

To repeat a comment from above: the problem was solved by moving the .load call further down the list of instructions inside the $.ready function. This is not the first time that I notice that Opera's JS engine appears to get ahead of itself. It would seem that the DOM-ready is fired before everything is truly ready.

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