在 Google Chrome 中检查 jsfiddle.net 上的 javascript

发布于 2024-10-31 23:11:34 字数 222 浏览 5 评论 0原文

是否可以使用 google chrome 检查器在输入 jsfiddle.net 的 javascript 代码上设置断点?

当我转到开发人员工具的脚本选项卡时,我看到很多脚本,但我不知道在哪里可以找到我的脚本,或者是否可以在那里找到它。过去我只是满足于一些 console.log 操作,但我很想设置一些断点。

(如果不可能的话,我对在这种情况下检查 javascript 的其他方法感兴趣。)

Is it possible to set breakpoints using the google chrome inspector on javascript code entered into jsfiddle.net?

When I go to the script tab of the developer tools I see lots of scripts but I don't know where my script would be found or if it can be found in there at all. In the past I have just settled for some console.log action but I would love to set some breakpoints.

(If not possible I am interested in other ways of inspecting javascript in this scenario.)

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

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

发布评论

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

评论(4

记忆消瘦 2024-11-07 23:11:34

调试器调用在 jsfiddle 上运行良好。
只要在你想要开始调试的地方输入这一行:

debugger;

Debugger is important for running debug mode in chrome, firebug and even IE dev tools,但你通常需要启动调试器(即在 IE 中“开始调试”,打开 firebug/developer工具)。

Debugger calls work fine on jsfiddle.
Just enter this line where you want to start debugging:

debugger;

Debugger is great for starting debug mode in chrome, firebug and even IE dev tools, but you usually need to have the debugger started (ie "start debugging" in IE, open firebug/developer tools).

小红帽 2024-11-07 23:11:34

在开发工具的脚本选项卡下,如果您从下拉列表中选择 fiddle.jshell.net,大约第 20-30 行(取决于您拥有的 CSS 数量),您将看到 < ;script> 标签,包含来自 Javascript 小提琴窗口的代码。您可以在此处设置断点。

您还可以通过更改控制台上下文来针对此框架评估控制台中的代码:

In the Developer Tools, under the Script tab if you select fiddle.jshell.net from the dropdown, around line 20-30 (depending on how much CSS you have) you will see a <script> tag that contains the code from the Javascript fiddle window. You can set your breakpoints here.

You can also evaluate code in the Console against this frame by changing the console context:

愁以何悠 2024-11-07 23:11:34

另一个技巧是使用以下语法在没有编辑器的情况下显示小提琴:

<normal path to your fiddle>/show/light/

例如: jsfiddle-链接

Another trick is to show your fiddle without the editor using the following syntax:

<normal path to your fiddle>/show/light/

as an example: jsfiddle-link

季末如歌 2024-11-07 23:11:34

从开发者控制台转到选项卡 sources,打开源树表示(左侧),打开 fiddle.jsshell.net 节点,然后单击 _display< /code>,下一个 (index),您应该会看到您的代码。

请注意,如果您保存代码,此 _display 引用将被 fiddle-reference/version/show 替换。例如 JsQfE/2/show (据我所知,它不存在,但可以作为示例完成这项工作)

在此处输入图像描述

From the developer console go to tab sources, open the sources tree representation (on the left), open the fiddle.jsshell.net node, next click _display, next (index) and you should see your code.

Note that if you save your code this _display reference will be replaced by fiddle-reference/version/show. For example JsQfE/2/show (which doesn't exist as far as I know but does the job as an example).

enter image description here

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