Skip to content

Instantly share code, notes, and snippets.

@chardcastle
Created September 7, 2011 08:29
Show Gist options
  • Save chardcastle/1200055 to your computer and use it in GitHub Desktop.
Save chardcastle/1200055 to your computer and use it in GitHub Desktop.
Console safety for IE
// code yanked from the Yahoo media player. Thanks, Yahoo.
// via http://ajaxian.com/archives/graceful-degradation-of-firebug-console-object
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