调试器只在第一行停止(如果我在那里放置断点),但如果我在任何其他行放置断点则不会停止。即使我在脚本中键入“调试器”,它确实会暂停并向我显示它在正确的 javascript 文件中暂停,但它会将第一行显示为事件执行行。
var someVar = 0; //<-- does stop here when I put a break point here
$(document).ready(function()
{
debugger; //<-- makes it stop but shows the first line as the active line
alert('here!'); //<-- does not stop with a breakpoint here, but does execute the code
});
我尝试重新启动 chrome,并在 Canary 中进行了尝试,令我惊讶的是,它显示了完全相同的行为。此外,此行为仅发生在 1 个特定文件中。即使我清空它并放入一些简单的测试代码,它仍然保持不变。
最佳答案
嗯。我删除了文件并重新创建了它,现在调试再次正常进行
关于javascript - Chrome 调试器只在第一行停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18613940/