在 Chrome 调试器中编辑 [英] Editing in the Chrome debugger

查看:37
本文介绍了在 Chrome 调试器中编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Chrome 调试器中动态"编辑 JavaScript 代码?它不适合我,所以我无权访问源文件.我想编辑代码并查看它们对页面的影响,在这种情况下,阻止动画多次排队.

How do I "dynamically" edit JavaScript code in the Chrome debugger? It's not for me, so I don't have access to the source file. I want to edit code and see what effects they have on the page, in this case stopping an animation from queuing up a bunch of times.

推荐答案

您可以使用 Chrome Developer Tools 中Scripts"选项卡下的内置 JavaScript 调试器(在更高版本中为Sources"选项卡),但更改您申请的代码仅在执行通过它们时才表示.这意味着对页面加载后未运行的代码所做的更改不会产生影响.不像例如对驻留在 mouseover 处理程序中的代码进行更改,您可以对其进行动态测试.

You can use the built-in JavaScript debugger in Chrome Developer Tools under the "Scripts" tab (in later versions it's the "Sources" tab), but changes you apply to the code are expressed only at the time when execution passes through them. That means changes to the code that is not running after the page loads will not have an effect. Unlike e.g. changes to the code residing in the mouseover handlers, which you can test on the fly.

有一段来自 Google I/O 2010 活动的视频介绍了 Chrome 开发者工具的其他功能.

There is a video from Google I/O 2010 event introducing other capabilities of Chrome Developer Tools.

这篇关于在 Chrome 调试器中编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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