Created
April 30, 2013 00:23
-
-
Save ethagnawl/5485839 to your computer and use it in GitHub Desktop.
Cross-browser log utility function
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
window.log = (function () { | |
if (window.console && window.console.log) { | |
return function (message) { | |
console.log(message); | |
} | |
} else { | |
return function (message) { | |
alert(message); | |
} | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment