Skip to content

Instantly share code, notes, and snippets.

@PatrickLef
Created April 17, 2011 14:19
Show Gist options
  • Save PatrickLef/924066 to your computer and use it in GitHub Desktop.
Save PatrickLef/924066 to your computer and use it in GitHub Desktop.
How to avoid console.* crashes in Internet Explorer
if (! ('console' in window) || !('firebug' in console)) {
var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
window.console = {};
for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment