Chrome可以在不进行整个页面刷新的情况下即时编辑Javascript,类似于Visual Studio的编辑和继续执行文件后代码的功能。这有助于在原型化JavaScript功能或片段时使用。在Chrome中实时编辑Javascript,例如在Visual Studio中编辑并继续
你必须点击一个断点,然后点击编辑按钮。然后当前的功能将被展开,然后您可以在更改生效的情况下回到当前功能。几乎没有VS编辑和继续,但至少它是一些东西。此外,它似乎有些东西不能改变。
有没有其他的工具可以做活javascript编辑,还是有更好的方法吗? Visual Studio 2010并不如我所知。
function test1() {
debugger;
var data_array = [];
var newvar1 = newfunc()+'dc'; // ok - can edit
var newvar2 = "hey2"; // ok - can edit
var newvar3 = 4; // ok can edit
var someobj = {1:"hey2", 2:"string2"}; // no - can not edit values after executed once
var word_array = ["hello", "goodbye", "adios"]; // no - can not edit values after executed once
for (var counter = 0; counter < 500; counter++) {
data_array[counter] = counter + word_array[Math.floor(Math.random() * (word_array.length))];
}
}
function newfunc() {
return "yes44";
}
类似的问题:
Using Google Chrome to debug and edit javascript embedded in HTML page
Editing in the Chrome debugger
自动保存插件 http://www.google.com/intl/cs-CZ/events/io/2010/sessions/chrome-developer-tools.html 谷歌演示: https://github.com/NV/chrome-devtools-autosave
你可以使用Opera。 Opera允许编辑内联JS和JS文件。软重新加载页面后,将应用您的更改。右键单击>源>更改>应用更改。 – XP1 2012-06-25 17:42:23
“编辑”按钮在哪里? – Mark 2013-03-06 09:58:21