Fallback for console.log for those browsers that do not offer it or use this cross browser integration. Sadly we are still stuck with IE8 for some projects ;)
1 2 3 4 5 6 7 8 9 10 11 |
var alertFallback = true; if (typeof console === "undefined" || typeof console.log === "undefined") { console = {}; if (alertFallback) { console.log = function(msg) { alert(msg); }; } else { console.log = function() {}; } } |