leeand00 leeand00 - 5 months ago 20
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

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() {};
     }
   }