leeand00 leeand00 - 1 year ago 53
Javascript Question

What happened to console.log in IE8?

According to this post it was in the beta, but it's not in the release?

Answer Source

Even better for fallback is this:


   var alertFallback = true;
   if (typeof console === "undefined" || typeof console.log === "undefined") {
     console = {};
     if (alertFallback) {
         console.log = function(msg) {
              alert(msg);
         };
     } else {
         console.log = function() {};
     }
   }