/ Published in: JavaScript
Helps to manage console.log debug in js when broswing in IE. If alertFallback is enabled, you can see js alerts appears of vars tracked.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var alertFallback = false; // enable if you wanna see alerts msg if (typeof console === "undefined" || typeof console.log === "undefined") { console = {}; if (alertFallback) { console.log = function(msg) { alert(msg); }; } else { console.log = function() {}; } }
URL: http://stackoverflow.com/questions/690251/what-happened-to-console-log-in-ie8