简体   繁体   中英

Can I modify Javascript code in Internet Explorer 11's debugger?

In IE11 I can right click on a webpage and call the "Inspect Element" tool. This allows me to modify HTML/CSS dynamically and is extremely useful.

在此输入图像描述

I can choose "Edit as HTML" and do whatever I want without having to reload the page.

在此输入图像描述

What I want is to be able to do the same in IE 11's Javascript debugger. I want to modify a script in the browser so that I do not have to reload the page entirely. The page I am working on takes 20-40seconds to load when I run it locally, meaning it takes about a minute to implement even the smallest changes in my file.js.

Can this be done?

If the JS code is embed into the HTML it should work without any problems but if it's stored I an other file you probably can't edit it in the browser. I recommend using Firefox or chrome. Both have got an inbuilt and very useful editors which can edit HTML as well as Js and CSS .

I know this is an older post but this might help someone else.

"I just loaded up my website in Chrome and whilst I can edit the Javascript file (you can definitely edit Javascript when it is in a .html page) but I cannot get the changes I have made in the .js file to actually function."

If you set a breakpoint at the top of the .js file and refresh, you can edit the code that comes after the break point and chrome will load your new changes. Note that your changes will be wiped out after every refresh, but it will hit your breakpoint and allow you to add them again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM