Created
September 15, 2012 01:07
-
-
Save robertpateii/3725899 to your computer and use it in GitHub Desktop.
my javascript utilities file
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
/*####---------------------BEGIN UTIITIES---------------------####*/ | |
/** | |
* check for console. if it's not present, creates a console | |
* object with methods that do nothing. Thus you avoid errors | |
* in browsers without a console. | |
*/ | |
if(typeof console === "undefined") { | |
console = { | |
debug: function() { }, | |
dir: function() { }, | |
error: function() { }, | |
group: function() { }, | |
groupCollapsed: function() { }, | |
groupEnd: function() { }, | |
info: function() { }, | |
log: function() { }, | |
time: function() { }, | |
timeEnd: function() { }, | |
trace: function() { }, | |
warn: function() { } | |
}; | |
} | |
/*####---------------------END UTIITIES---------------------####*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment