调试奇怪的 JavaScript 行为
我有一个使用 JQuery UI 选项卡和其他一些零碎内容的页面。当用户打开此页面并快速单击某个选项卡时,大约一秒钟后页面会再次恢复到第一个选项卡!
我正在尝试使用 Firebug 来查看发生了什么,但据我所知,当发生反转时 body
标记会突出显示,但其中没有任何内容。我是 Firebug 的新手 - 我如何使用它来更好地了解这里发生的情况?
I have a page that uses JQuery UI Tabs and some other bits and pieces. When a user opens this page and quickly clicks on some tab, after a second or so the page reverts to the first tab again!
I am trying to use Firebug to see what's going on, but as far as I can see, when that reversion occurs the body
tag highlights, but nothing within it. I am a novice with Firebug - how can I use it to better understand what's going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只能在没有具体示例的情况下进行猜测,但听起来您正在初始化选项卡两次。选项卡必须已启用,以允许选项卡之间的初始导航。然后选项卡的第二次初始化是将视图重置回第一个选项卡。
您正在初始化
$(document).ready
中的选项卡,而不是window.onload
,对吧?I can only take a guess without a concrete example, but it sounds you're initialising the tabs twice. The tabs must already be enabled which is allowing the initial navigation between tabs. Then a second initialisation of the tabs is resetting the view back to the first tab.
You are initialising the tabs inside
$(document).ready
and notwindow.onload
, right?