What is Firebug?
Is Firebug only for Firefox?
Alternatives with similar functionality for other Web browsers:
- The Internet Explorer Developer Toolbar for Microsoft IE.
- IE 8 comes with its own development tools.
- Dragonfly for Opera. - A short introduction from SitePoint
- The Web Inspector menu item in Safari.
Where can I get Firebug?
- And for those of us who prefer viewing to reading, there's a bunch of tutorial videos on YouTube.
Debugging AJAX with Firebug
Once installed, Firebug can show you the XMLHTTPrequests that happen in the background as AJAXy things occur and also what data is returned. This is pretty handy if you find that the requests are failing for no reason you can discern.
To make the most of this, it's important to make sure that the data being sent by the server is properly encoded and has the right headers. The most efficient way to do this is to use JSON for the response, rather than XML (fewer characters used to represent stuff, so faster to download) and to do so using PHP's native json_encode() function. This will make firebug show you the response in a lot more detail than if you just echoed the data as XML fragments.
To watch the XMLHTTPrequests, enable firebug, click on the Net tab and enable that too, then click on the XHR button. Now, anything that happens will show up in Firebug. To see the response data from the server, expand the line for that request using the + icon on the left, then click on the response tab. This shows the raw data but you should also have a JSON and/or HTML tab which will allow you to see it properly formatted.
- See also
There are some enhancements to make Firebug even more powerful.
- Firebug Swarm - recommended enhancements for Firebug
- See the complete list of Firebug related add-ons on the Mozilla website.
- Mehr Power für Firebug is an article written in German, but you can just follow the links to the Firefox add-on page.
Here are some of those enhancements.
Note: Some of these enhancements are experimental. Caution should be used when installing experimental add-ons, as they have not been tested by an editor and may harm your computer configuration.
There's also CodeBurner for Firefox, a standalone version of the original CodeBurner for Firebug, but with an independent interface, and more dedicated search tools.
YSlow - YSlow analyzes web pages and tells you why they're slow based on Yahoo's rules for high performance web sites.
Firefinder - Finds HTML elements matching chosen CSS selector(s) or XPath expression.
FireQuery is a collection of Firebug enhancements for jQuery. Requires Firebug 1.3 or greater.
- jQuery expressions are intelligently presented in Firebug Console and DOM inspector
- attached jQuery data are first class citizens
- elements in jQuery collections are highlighted on hover
- jQuerify: enables you to inject jQuery into any page
Inline Code Finder for Firebug
Inline Code Finder for Firebug is an add-on to Firebug, to be able to find HTML elements with any of the below issues:
- Inline style
FlashFirebug: Debug your own SWF files inside the browser. Edit properties and inspect elements like you do to HTML. Flash files are no longer the closed components they used to be. This extension requires Firebug and the O-Minds Flash package.
FireFile: Firebug extension to save the CSS files edited with firebug live to your web server. That makes Firebug become the first remote-save live-preview CSS editor and allows ultra-fast webdesign.
Firebug Autocompleter - Firebug command line autocomplete.