Return to Snippet

Revision: 63637
at May 24, 2013 00:36 by bitsculptor


Initial Code
// make it safe to use console.log always
(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}})
(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}());

Initial URL

                                

Initial Description
IE doesn't like console.log. This fixes that.

Initial Title
Safe console.log usage in all browsers

Initial Tags
ie, log

Initial Language
JavaScript