Stop Firebug Console Command Errors

/ Published in: JavaScript
Save to your folder(s)

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.

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


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.