Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

enter image description here

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

enter image description here

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?

like image 245
John 'Mark' Smith Avatar asked Apr 29 '15 14:04

John 'Mark' Smith


People also ask

How do I edit JavaScript debugger in IE?

Our first experiment in the latest build allows you to edit any JavaScript file in the debugger source viewer. Enable the “Edit JavaScript” toggle and restart your browser. Once the feature is enabled, simply click on the Debugger's source viewer to place the cursor and start modifying your JavaScript!

How do you change JavaScript in Internet Explorer?

Internet ExplorerClick Tools > Internet Options. Click the Security tab > Custom Level. In the Scripting section, click Enable for Active Scripting. In the dialog box that displays, click Yes.

Does IE 11 support JavaScript?

Internet Explorer 11 doesn't support JavaScript versions later than ES5. If you want to use the syntax and features of ECMAScript 2015 or later, or TypeScript, you have two options as described in this article. You can also combine these two techniques.


2 Answers

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 .

like image 127
Coretool Avatar answered Oct 24 '22 02:10

Coretool


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.

like image 20
BK1NG Avatar answered Oct 24 '22 02:10

BK1NG