如何使用 Firebug 检查 javascript 超时?
我怀疑 javascript 中触发刷新的超时函数存在问题。 Firebug 中有没有办法查看已注册的超时?
编辑:我想我不清楚,有没有办法查看超时回调列表或其状态? (剩余时间、是否被解雇、注册功能等......)
I suspect I have an issue with a timeout function in javascript that triggers a refresh. Is there a way in Firebug to view what timeouts have been registered?
Edit: I guess I wasn't clear, is there a way to view the list of timeout callbacks or their status? (Timeleft, fired or not, registered function, etc....)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您命名了所有超时,您可以在 firebug 中查看它们。
然后在控制台中,您只需输入
t1
并按 enter或在控制台中输入
console.log(t1)
并按 输入If you name all the timeouts you can view them in firebug.
Then in the console you can just type in
t1
and press enterOr type
console.log(t1)
into the console and press enter只需使用 console.log('your message here'); 来跟踪您的函数执行。
在函数的开头调用它,您就会知道该函数正在被调用。
如果将其放置在
setTimeout
调用的函数中,您将知道它触发了多少次。Just use
console.log('your message here');
to track your function executions.Call it at the beginning of a function and you will know that that function is being called.
If you place it in the function being called by the
setTimeout
, you will know how many times it triggered.您需要从 JavaScript 向 Firebug 控制台发送消息。
应该像 console.debug() 一样简单,
所以
请参阅: http://getfirebug.com/wiki/ index.php/Console_API
You need to from your javascript send messages to the firebug console.
should be as easy as console.debug()
so
see: http://getfirebug.com/wiki/index.php/Console_API