问题描述
我是Firebug的新手并且遇到很多麻烦。
I'm new to Firebug and having a lot of trouble.
- JavaScript文件通常显示为空或部分加载(某些当时)
- 线路无法频繁设置断点(行号显示为灰色)
- 当我设置断点时,脚本执行通常不会停在他们身上
我正在使用Firebug 1.3.3和Firefox 3.0.11。我已禁用所有其他附加组件。我正在从localhost加载Javascript。有时候关闭窗口并重新打开我正在清理的页面,但是这个页面加载时不会超过几页。
I'm using Firebug 1.3.3 and Firefox 3.0.11. I have disabled all other Add-ons. I'm loading Javascript from localhost. Sometimes closing the window and re-opening the page I was on clears things up, but that never lasts for more than a couple page loads.
我正在学习jQuery,显然有一个庞大的库,但我想其他很多人都使用Firebug,所以这应该不是问题。此外,大多数时候(但并非总是如此),Firefox加载并执行JavaScript没有问题;只是Firebug看不到它。
I'm working on learning jQuery, which obviously has a huge library, but I imagine many other people use Firebug for the same, so that shouldn't be a problem. Also, most of the time (but not always), Firefox loads and executes the JavaScript no problem; just Firebug can't see it.
尽职调查:
这些讨论似乎涵盖了同样的问题,但没有答案:
These discussions seem to cover the same problem, but have no answers:
- Firebug没有显示Javscript错误 - http://groups.google.com/group/firebug/browse_thread / thread / 443848cd11be48e1?pli = 1
- firebug并不总是加载javascript - http://code.google.com/p/fbug/issues/detail?id = 1644& q =空%20javascript& colspec = ID%20Type%20Status%20Owner%20Test%20Summary
(对不起,我是新手,不允许超链接那些)
(Sorry I'm new, and not allowed to hyperlink those)
推荐答案
一些建议。确保Firebug的控制台,网络和脚本面板都已打开。
A couple suggestions. Make sure that you have the console, net, and script panels of Firebug all turned on.
您应该在网络面板中看到已下载的js文件。在控制台面板中,您应该能够键入 console.log(jQuery)
并返回 function()
。
You should see in the net panel what js files have downloaded. In the console panel, you should be able to type console.log(jQuery)
and get back function()
.
这应该确认jQuery实际上已经加载并运行。
This should confirm that jQuery is actually loaded and running.
然后转到你的脚本面板,然后你应该看到顶部的四个选项。检查,编辑,静态,然后下载脚本的下拉列表。这就是你想要的那个。选择要调试的脚本。
Then go to your script panel, and you should see four options across the top. Inspect, Edit, Static, and then a drop down list of your scripts. That's the one you want. Select the script that you want to debug.
根据您的问题,您可能已经知道其中一些,但确认所有这些都是先工作。
Based on your question, you probably know some of this already, but confirm that all of that is working first.
如果在脚本列表中没有看到jQuery,可以执行 console.log(jQuery)
吗?
When you don't see jQuery in the scripts list, can you do console.log(jQuery)
?
PS。这不是规模问题。我经常加载大小比jQuery大10倍的js文件。
PS. It's not a matter of size. I routinely load js files that are 10x the size of jQuery.
编辑:还有一些建议:
1)减少到最简单的情况并加回。删除除jQuery之外的所有脚本,然后逐步添加其他脚本。是否有一个一直打破它。
1) Reduce to simplest case and add back. Remove all your scripts other than jQuery and then add your other scripts incrementally. Is there one that consistently breaks it.
2)将try / catch语句放在可疑代码块周围。我经常发现FB在抛出未捕获的异常后停止报告错误。
2) Put try / catch statements around suspicious code blocks. I've often found that FB stops reporting errors after an uncaught exception has been thrown.
try {
// your code here
} catch (e) {
console.log(e)
}
3)设置另一个FF配置文件以测试是否遇到同样的问题。
3) Setup another FF profile to test if you get the same problem.
这篇关于Firebug不会加载JavaScript文件或停止在断点上执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!