How to edit JavaScript in Firebug?

JavascriptFirebugEdit

Javascript Problem Overview


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.

Javascript Solutions


Solution 1 - Javascript

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.

Solution 2 - Javascript

As far as I know only Chrome's dev tools support editing JavaScript inside their Sources tab (not just via the command line). And you can add an extension like Tincr or DevTools Autosave and Chrome will save the changes to your JavaScript files on the disk. So it is pretty much a complete IDE for JavaScript.

Otherwise if you are using Firebug, you would have to test your code in the Command Editor, then open your text editor and open that file you were looking in Firebug and then add those changes inside your text editor and save.

I hope that one day they will enable JavaScript to be editable inside the Script panel of Firebug.

Solution 3 - Javascript

There is a "Scratchpad" built into the Mozilla framework. This can be reached from within Firefox.

In the "Tools" menu under "Web Developer"->"Scratchpad".

Or...

Just right click on any element on your page. Select "inspect element" On the inspector toolbar, far to the right, there is a noteblock "Scratchpad", press it.

enter image description here

Now you get a Javascript editor with syntax highlightning etc.. From here you can open/save your javascript source file.

enter image description here

Read more bout it [here][3].

[3]: https://developer.mozilla.org/en-US/docs/Tools/Scratchpad "here"

Solution 4 - Javascript

In the Firebug console, you can type in new javascript. So just redefine functions or variables as needed through that.

Solution 5 - Javascript

You can't do it. You should use javascript console to redefine functions.

Solution 6 - Javascript

You can also use fiddler.
I use it and it has worked out for me pretty well.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTCMView Question on Stackoverflow
Solution 1 - JavascriptMatthew AbbottView Answer on Stackoverflow
Solution 2 - JavascriptPavle LekicView Answer on Stackoverflow
Solution 3 - JavascriptMax KiellandView Answer on Stackoverflow
Solution 4 - JavascriptjalfView Answer on Stackoverflow
Solution 5 - JavascriptPavel StrakhovView Answer on Stackoverflow
Solution 6 - JavascriptLearningEverydayView Answer on Stackoverflow