Skip to content

Instantly share code, notes, and snippets.

@michaeldv
Created May 22, 2012 01:17
Show Gist options
  • Save michaeldv/2765895 to your computer and use it in GitHub Desktop.
Save michaeldv/2765895 to your computer and use it in GitHub Desktop.
Make IE shut up when encountering console calls
window.console or do ->
window.console = {}
for method in [ "log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd" ]
window.console[method] = ->
return
window.console || (function() {
var method, _i, _len, _ref;
window.console = {};
_ref = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
method = _ref[_i];
window.console[method] = function() {};
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment