Skip to content

Instantly share code, notes, and snippets.

@bumi
Created November 20, 2008 16:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bumi/27085 to your computer and use it in GitHub Desktop.
Save bumi/27085 to your computer and use it in GitHub Desktop.
fakebug - don't let console.log break your code on browsers without firebug
var fakebug = function() {
var firebug_methods = ["log", "info", "debug", "warn", "error", "assert", "dir", "dirxml", "trace", "group", "groupEnd", "time", "timeEnd", "profile", "profileEnd", "count"];
window.console = {};
for(var i=0;i<firebug_methods.length;i++) {
window.console[firebug_methods[i]] = function() {};
}
};
if(!window.console) { fakebug(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment