We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

1man on 03/18/08


Tagged

command console firebug lite


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

SpinZ


Stop Firebug Console Command Errors


Published in: JavaScript 


URL: http://getfirebug.com/lite.html

Sometimes i forget to remove firebug console commands when debuging, which makes IE and some other browsers fail / cry.

To stop this happening use the below script from firebugx.js on the firebug lite homepage.


  1. if (!window.console || !console.firebug){
  2. var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
  3. "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
  4.  
  5. window.console = {};
  6. for (var i = 0; i < names.length; ++i)
  7. window.console[names[i]] = function() {}
  8. }

Report this snippet 

You need to login to post a comment.