Logging in the console of firebug without errors in IE
In some cases the console in firebug is really helpfull. For instance when you are debugging mouse-events. The downside of using "console.log()" is that it triggers errors in IE. But there is a really simple sollution for that problem. Include the folowing line of code in one of your js scripts and no more errors in IE:
if(!console){var console = new Object();console.log = function(){}}
This snippet is tested in IE7 and IE6
update 13-11-2007: or use firebuglite: http://getfirebug.com/lite.html
if(!console){var console = new Object();console.log = function(){}}
This snippet is tested in IE7 and IE6
update 13-11-2007: or use firebuglite: http://getfirebug.com/lite.html
Labels: console, firebug, javascript
1 Comments:
Good words.
By
Manuela, At
October 29, 2008 6:20 AM
Post a Comment
<< Home