且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在运行时修改javascript代码?

更新时间:2023-12-06 15:31:52

Chrome,Safari和其他基于WebKit的浏览器在Web检查器中包含一项称为实时编辑的功能。如果您转到脚本面板并在断点处停止(或者即使没有在断点处停止-我不确定),则可以双击一行并开始编辑该行。您所做的更改将在脚本上生效。

Chrome, Safari, and some other WebKit-based browsers contain a feature in the Web Inspector known as Live Edit. If you go to the Scripts panel and are stopped on a breakpoint (or maybe even if not stopped on a breakpoint — I'm not sure), you can double click on a line and start editing that line. The changes you make will take effect on the script.