Posted By

Simounet on 01/05/12


Tagged

ie console log


Versions (?)

Manage console.log on IE


 / Published in: JavaScript
 

URL: http://stackoverflow.com/questions/690251/what-happened-to-console-log-in-ie8

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.

  1. var alertFallback = false; // enable if you wanna see alerts msg
  2. if (typeof console === "undefined" || typeof console.log === "undefined") {
  3. console = {};
  4. if (alertFallback) {
  5. console.log = function(msg) {
  6. alert(msg);
  7. };
  8. } else {
  9. console.log = function() {};
  10. }
  11. }

Report this snippet  

You need to login to post a comment.