Skip to content

Instantly share code, notes, and snippets.

@pete-otaqui
Created September 22, 2011 08:59
Show Gist options
  • Save pete-otaqui/1234379 to your computer and use it in GitHub Desktop.
Save pete-otaqui/1234379 to your computer and use it in GitHub Desktop.
Fake Firebug API, allows safe use of Firebug / Web Inspector commands without breaking IE
/**
* Create a fake console api, mimicing Firebug.
*/
(function(global) {
var noop = function(){};
if ( !global['console'] ) {
global.console = {
log : noop,
debug : noop,
info : noop,
warn : noop,
error : noop,
assert : noop,
clear : noop,
dir : noop,
dirxml : noop,
trace : noop,
group : noop,
groupCollapsed : noop,
groupEnd : noop,
time: noop,
timeEnd: noop,
profile: noop,
profileEnd: noop,
count: noop,
exception: noop,
table: noop
}
}
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment