admin管理员组文章数量:1404621
Chrome can edit Javascript on the fly, without a full page refresh, similar to Visual Studio's edit and continue ability for code behind files. This helps when prototyping javascript functions or snippets.
You have to hit a breakpoint, then hit the edit button. Then the current function will be unrolled, then you can step back into it with your changes in effect. Not nearly as nice as VS edit and continue, but at least it's something. Also it appears some things cannot be changed.
Is there any other tool that can do live javascript edits, or is there a better way? Visual Studio 2010 does not as far as I can tell.
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";
}
Similar questions:
Using Google Chrome to debug and edit javascript embedded in HTML page
Editing in the Chrome debugger
Autosave plugin .html Googles presentation:
Chrome can edit Javascript on the fly, without a full page refresh, similar to Visual Studio's edit and continue ability for code behind files. This helps when prototyping javascript functions or snippets.
You have to hit a breakpoint, then hit the edit button. Then the current function will be unrolled, then you can step back into it with your changes in effect. Not nearly as nice as VS edit and continue, but at least it's something. Also it appears some things cannot be changed.
Is there any other tool that can do live javascript edits, or is there a better way? Visual Studio 2010 does not as far as I can tell.
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";
}
Similar questions:
Using Google Chrome to debug and edit javascript embedded in HTML page
Editing in the Chrome debugger
Autosave plugin http://www.google./intl/cs-CZ/events/io/2010/sessions/chrome-developer-tools.html Googles presentation: https://github./NV/chrome-devtools-autosave
Share Improve this question edited May 23, 2017 at 12:00 CommunityBot 11 silver badge asked Apr 18, 2012 at 12:00 GravityWellGravityWell 1,5671 gold badge18 silver badges24 bronze badges 2- 1 You could use Opera. Opera allows editing of inline JS and JS files. After you soft reload the page, your changes will be applied. Right click > Source > Make changes > Apply Changes. – XP1 Commented Jun 25, 2012 at 17:42
- Where is the "edit" button? – Mark Commented Mar 6, 2013 at 9:58
1 Answer
Reset to default 2You may want to try Chrome Dev Tools for Java project. It is an Eclipse plugin for debugging JavaScript in Chrome that could be used together with a JavaScript IDE plugin. This way you edit and debug and live edit the very same file (see text).
本文标签:
版权声明:本文标题:debugging - Editing Javascript in Chrome real time, like Edit and Continue in Visual Studio - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744837872a2627742.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论