Opera 10.6 中的 jQuery.load 未触发完成
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重复上面的评论:通过将 .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.