Created
February 13, 2015 20:04
-
-
Save rex/6bd2e1b103f3ba1692e4 to your computer and use it in GitHub Desktop.
Simple protection against loose console.log() statements killing the JS engine in browsers without console.* methods (ahemIEahem)
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
| // Put this inside a <script></script> tag at the very tippy top of your page to make sure it works properly. | |
| var noop = function() {} | |
| if(window.console == undefined) { | |
| window.console = { | |
| log: noop, | |
| error: noop, | |
| warn: noop, | |
| table: noop | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment