How to edit JavaScript in Firebug?

TCM picture TCM · Jul 8, 2010 · Viewed 93k times · Source

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.

Answer

Matthew Abbott picture Matthew Abbott · Jul 8, 2010

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.