Chrome开发人员工具中无法使用JavaScript断点 [英] Javascript breakpoints not working in Chrome Developer Tools

查看:177
本文介绍了Chrome开发人员工具中无法使用JavaScript断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用firebug for Firefox,我可以在我的JS代码中设置一个断点,刷新页面,代码会在我的断点处自动暂停(我的代码在页面加载时运行)。

Using firebug for Firefox, I can set a breakpoint in my JS code, refresh the page and the code will automatically pause at my breakpoint (my code runs on page load).

当我在Chrome开发人员工具(Ctrl + Shift + J)中执行相同操作时,它不会停在断点处。如何让代码停在断点处?

When I do the same in Chrome Developer Tools (Ctrl + Shift + J), it does not stop at the breakpoints. How do I get the code to stop at the breakpoints?

另外,我的console.logs出现在Firefox的firebug中,但不出现在Chrome控制台中。我如何让Chrome控制台显示我的控制台日志?

Also, my console.logs appear in firebug for Firefox, but not in the Chrome console. How do I get the Chrome console to display my console logs?

推荐答案

断点适合我;按下Ctrl-shift-i,点击脚本标签,选择你想要的脚本,然后点击你想要设置断点的行号。断点可能被禁用;确保脚本选项卡右侧的按钮(逐步,逐步和按钮旁边的按钮)显示一条直线。

Breakpoints work for me; Press Ctrl-shift-i, click the Scripts tab, select the script that you want, then click on the line number where you would like to set the breakpoint. Breakpoints may be disabled; make sure that the button on the right side of the Scripts tab (next to step over, step out, and step in buttons), shows a line through it.

如果这不适合你,请尝试重新启动浏览器,禁用扩展功能,创建测试HTML页面等。

If this isn't working for you, try restarting the browser, disabling extensions, creating a test HTML page,, etc.

这篇关于Chrome开发人员工具中无法使用JavaScript断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆