Created
November 20, 2008 16:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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