如何在Google Chrome中设置内联Javascript中的断点? [英] How to set breakpoints in inline Javascript in Google Chrome?

查看:140
本文介绍了如何在Google Chrome中设置内联Javascript中的断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在谷歌浏览器中打开开发者工具时,我会看到各种功能,如个人档案,时间表和审核,但是基本功能就像在js文件和html和javascript代码之间设置断点一样!我试图使用JavaScript控制台,它本身就是错误的 - 例如,一旦遇到JS错误,我无法离开它,除非我刷新整个页面。有人可以帮忙吗?

When I open Developer Tools in Google Chrome, I see all kinds of features like Profiles, Timelines, and Audits, but basic functionality like being able to set breakpoints both in js files and within html and javascript code is missing! I tried to use the javascript console, which itself is buggy - for example, once it encounters a JS error, I cannot get out of it unless I refresh the whole page. Can someone help?

推荐答案

使用sources选项卡,可以在JavaScript中设置断点。在其下的目录树中(其中有向上和向下箭头),您可以选择要调试的文件。您可以按同一标签右侧的简历来摆脱错误。

Use the sources tab, you can set breakpoints in JavaScript there. In the directory tree underneath it (with the up and down arrow in it), you can select the file you want to debug. You can get out of an error by pressing resume on the right-hand side of the same tab.

这篇关于如何在Google Chrome中设置内联Javascript中的断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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