Reputation: 28888
I have a problem with the current version of FireBug.
Firefox: 3.6.13
Firebug: 1.6.0 and 1.6.1b1 (tried both)
My Javascript can't use console.log (or any console at all) to output debug messages. I'm not sure when it stopped working, but for now I get an "console is not defined" when I try to access it or a message popup when I run this code:
if (console == undefined) {
alert(1);
}
I had the latest FirePHP extension (DeveloperCompanion) installed but removed it to see if that was causing the problem. Didn't change anything though.
Any ideas? Is this happening to someone else, too?
[UPDATE]
Looks like my problem was actually caused by something else: I use jQuery and have all my code wrapped in $(function() {.....});
to make it run after the page has been rendered.
What I didn't consider is that then the code runs in another scope. console
is not available in that scope.
To use the console I have to call window.console.log('bla');
.
Upvotes: 11
Views: 19581
Reputation: 69
In my case with Firefox version 44 and firebug version 2.0.14 I first disabled the plugin then removed it then installed it again... But this didn't helped me but after clicking bug icon --> Options --> Reset all options I again enabled the Console, and the All tab got selected and my issue got resolved...
Upvotes: 0
Reputation: 9
My problem was the first upper case letter. console.log() instead of Console.log() did it!
Upvotes: 0
Reputation: 42207
Had the same problem, the suggested solutions did'nt work. I solved it by resettting the Firebug options.
Firebugmenu (the bug icon), Options, 'Reset all firebug options'
After this, the console.log('hello');
test worked and so did my loggings.
Upvotes: 4
Reputation: 542
First, try opening a new tab in your browser and go to a different site, then run the console command in Firebug. If the console command works correctly, it is most likely another script (3rd party or otherwise) that you have loaded into your site/page that is causing your troubles. You could try excluding the script from your page and running the console command again to see if it works as well.
As mentioned in the other comments, always be sure to select "All" sub-tab in the Firebug "Console" tab as well.
References: http://mikepuchol.com/2008/10/27/if-you-use-firebug-and-consolelog-doesnt-work/
Upvotes: 1
Reputation: 11
I had the same problem - console.log was outputting nothing when used inside $(function() {.....}); in jQuery. However, using window.console.log('bla') didn't fix the issue for me.
I have now downloaded the FireQuery addon which has fixed the problem for me: https://addons.mozilla.org/en-US/firefox/addon/firequery/
Upvotes: 0
Reputation: 9788
My console.log also stopped working today, but simply restart of browser solved the issue, no need to re-install.
Upvotes: 1
Reputation: 81
I did a disable and remove of firebug plugin and then re-installed it. After that check the "All" option under the "Console" tab. In my case the output was getting echoed there after the re-install of the plugin.
Upvotes: 8
Reputation: 168843
Firebug's console
object is only available if Firebug is open. If you have Firebug closed and you load a page with console.log()
calls, then they'll throw errors.
Open the Firebug window and refresh the page.
If that still doesn't work, go to Firebug's console tab and try typing console.log('hello');
in the console input area and see if it works from there. That really ought to work.
If even that doesn't work then it sounds like you have a broken Firebug installation; you may need to re-install.
Upvotes: 2