Skip to content

Instantly share code, notes, and snippets.

@Usse
Created January 7, 2014 11:20
Show Gist options
  • Save Usse/8297972 to your computer and use it in GitHub Desktop.
Save Usse/8297972 to your computer and use it in GitHub Desktop.
Safe log function
$.log = function() {
var consoleExists = (typeof(console) == "object") && (typeof(console.log) == "function");
if (consoleExists) {
if (navigator.userAgent.toLowerCase().indexOf("applewebkit") != -1) {
console.log(arguments);
} else {
console.log.apply(this,arguments);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment