/ Published in: JavaScript
Provides a global trace() function similar to that in actionscript that gracefully fails if the browser does not support console.log()
Expand |
Embed | Plain Text
//Browser compatible console.log statement function trace() { if (trace.enabled) { console.log.apply(console, arguments); } else if (!trace.enablechecked) { trace.enablechecked = true; if (typeof(console) != "undefined") { if (typeof(console.log) == "function") { trace.enabled = true; trace.apply(this, arguments) } } } }
You need to login to post a comment.
