Created
May 22, 2012 01:17
-
-
Save michaeldv/2765895 to your computer and use it in GitHub Desktop.
Make IE shut up when encountering console calls
This file contains hidden or 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
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 |
This file contains hidden or 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
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