Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit JavaScript in Firebug?

I am only able to view the JavaScript files of the website via the Script panel. How can I edit it? I tried everything like double clicking the line that i want to edit etc., but it doesn't let me edit it.

If I move to the HTML tab, I am able to edit the HTML by clicking on the Edit button, but I am not able to edit the JavaScript.

like image 723
TCM Avatar asked Jul 08 '10 12:07

TCM


People also ask

How do I modify JavaScript?

After loading a web page completely, press the F12 key to open the developer tools, then open the 'Sources' tab. Now open any Javascript file loaded on the browser and you can directly edit it by clicking anywhere in that file. After making modifications press Ctrl+S to save the changes.

Can I edit JavaScript in Firefox?

Firefox Developer Tools is a set of web developer tools built into Firefox. You can use them to examine, edit, and debug HTML, CSS, and JavaScript.

How do I edit JavaScript in IE developer tools?

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!


1 Answers

alt text
(source: fidelitydesign.net)

You can use the Firebug Console tab to write Javascript. I use this quite a lot of rapid prototyping of code before I integrate it into my projects. When you use the Console, javascript is executed in the context of the current page. Therefore, and scripts that are currently defined for that page, can potentionally be redefind. E.g., in the Console window, I could do this:

$ = function() { alert("Whoops"); } 

...and that would redefine the $ function used by JQuery.

like image 130
Matthew Abbott Avatar answered Sep 20 '22 01:09

Matthew Abbott