If you have recently changed your Firefox configurations (and upgraded to Firebug 1.2) then you may have experienced some difficulties with console.log throwing the following error:
ReferenceError: console is not defined
It turns out that this is by design. If you want to make use of the console object that Firebug offers, you need to do so with a call to window.loadFirebugConsole() first.
A little bit of testing, and the following code can be safely put in your javascript source to enable use of the Firebug console object safely (without breaking other browsers).
if (window['loadFirebugConsole']) { window.loadFirebugConsole(); } else { if (!window['console']) { window.console = {}; window.console.info = alert; window.console.log = alert; window.console.warn = alert; window.console.error = alert; } }
Whilst you are at it, why not check out some of the other nifty commands available on the Firebug console object at the Get Firebug website.
Tags: JavaScript