Created
May 15, 2015 13:29
-
-
Save rjmunro/faf9d917972248c750d8 to your computer and use it in GitHub Desktop.
Shim for console.log in IE9 when run without developer tools
This file contains 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
// Shim console.log for IE9 when not run in with developer tools opened | |
// Stores log messages in window.consoleLog so you can retreive them when you open the tools. | |
(function () { | |
/*global window */ | |
if (!window.console) { | |
window.consoleLog = []; | |
window.console = { | |
log: function (msg) { | |
window.consoleLog.push([msg, (new Date()).toIsoString()]); | |
} | |
}; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment