在调试涉及焦点/模糊事件处理的 Javascript 时如何使用 Firebug

发布于 2024-08-21 09:50:52 字数 293 浏览 2 评论 0原文

我正在尝试使用 Firebug 来调试一些需要模糊和焦点事件处理的 Javascript,特别是一些自动完成/前瞻功能。问题是,仅通过单击 Firebug 中的各个选项卡(例如“Console”、“Script”、“DOM”等),我的应用程序中的 blur() 事件就会被触发,然后是当我随后在自动完成驱动的文本字段中单击返回时的 focus() 事件。事实上,当尝试与 Firebug 交互时,这些事件被不必要地触发,即使不是几乎不可能,也会使调试本身出现问题。

还有其他人遇到过第 22 条军规吗?和/或有人有解决方案/建议吗?

I'm trying to use Firebug to debug some Javascript that entails blur and focus event handling, specifically some auto-complete/look-ahead functionality. The issue is that, merely by clicking on the various tabs within Firebug, such as "Console", "Script", "DOM", etcetera, the blur() event in my application is being fired, and then the focus() event when I subsequently click back in the text field that auto-complete is being driven by. The fact that these events are being unnecessarily being fired when trying to interact with Firebug, makes the debugging itself problematic if not well nigh impossible.

Has anybody else encountered this Catch 22, and/or does anybody have solutions/suggestions?

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

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

发布评论

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

评论(4

顾北清歌寒 2024-08-28 09:50:52

使用键盘代替?
http://getfirebug.com/wiki/index.php/Keyboard_and_Mouse_Shortcuts

另外:
->选项->显示快速信息框(然后单击检查按钮)将显示有关您鼠标悬停的所有内容的信息胶囊 - 如果有帮助

Use keyboard instead?
http://getfirebug.com/wiki/index.php/Keyboard_and_Mouse_Shortcuts

Also:
->options->show quick info box (then click inspect button) will show a capsule of info about everything you mouse over - if that helps

就像说晚安 2024-08-28 09:50:52

您可以将它们切换为调试吗?即不要使用 blur()focus(),而是使用 click()hover()

Could you switch them to debug. i.e. instead of using blur() and focus() use click() or hover().

一直在等你来 2024-08-28 09:50:52

不确定你的问题,但正如 Alex 所说,你仍然可以使用控制台来记录事件和任何其他 JavaScript 内容。

例如,

var x =5;
console.info(x);
x = 9;
console.info(x);

在 JavaScript 中运行此代码,您将在控制台中看到它。

not sure about your question, but as Alex said, you can still use the console to log events and any other javascript things.

For example

var x =5;
console.info(x);
x = 9;
console.info(x);

Run this code in your javascript and you'll see it in the console.

探春 2024-08-28 09:50:52

在尝试设计预输入插件样式时也有类似的经历。我发现的最佳解决方案是右键单击 firebug dom 中的一个元素并检查“子添加和删除时中断”(您也可以在属性更改等时中断)。

Had a similar experience trying to style a typeahead plugin. Best solution I found was right-clicking an element in the firebug dom and checking "break on child addition and removal" (you can also break on attribute change etc).

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