如何使用 Firebug 检查 javascript 超时?

发布于 2024-12-04 08:02:27 字数 160 浏览 1 评论 0原文

我怀疑 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技术交流群

发布评论

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

评论(3

愿与i 2024-12-11 08:02:27

如果您命名了所有超时,您可以在 firebug 中查看它们。

var t1 = setTimeout(...,...);

然后在控制台中,您只需输入 t1 并按 enter

或在控制台中输入 console.log(t1) 并按 输入

If you name all the timeouts you can view them in firebug.

var t1 = setTimeout(...,...);

Then in the console you can just type in t1 and press enter

Or type console.log(t1) into the console and press enter

懷念過去 2024-12-11 08:02:27

只需使用 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.

深海不蓝 2024-12-11 08:02:27

您需要从 JavaScript 向 Firebug 控制台发送消息。

应该像 console.debug() 一样简单,

所以

setTimeout(
    function()
    {
        console.debug("EVENT!");
    },
    1500
);

请参阅: 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

setTimeout(
    function()
    {
        console.debug("EVENT!");
    },
    1500
);

see: http://getfirebug.com/wiki/index.php/Console_API

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