1

My javascript works on every browser except for IE which I need. The error I get when I run it on IE console is 'console' is undefined for " console.log(response); " . Any ideas?

var locations = new Array(); // create array here
var printers = new Array(); // create array here
$(document).ready(function(){
  data='';
  $.ajax({                                    
      type: "GET",
      url: "data.json",
      data: data,
      dataType:'json', //or HTML, JSON, etc.
      success: function(response){
          console.log(response);
          
      $.each(response.locations, function (index, l) {
          locations.push([l.location, l.value]); //push values here
       
      });             
      console.log(locations)
      $.each(response.printers, function (index, l) {
          printers.push([l[1], l[2], l[3], l[4], l[5], l[6], l[7], l[8]]); //push values here
       
      });             
          console.log(printers)

          init()
      },
      error: function(response){
        console.log(response);
        
      }
  });
})
M. Singh
  • 29
  • 6
  • The console is not available in some versions of IE. Here's a workaround for working with the console in IE8: http://stackoverflow.com/questions/690251/what-happened-to-console-log-in-ie8 – Shaun May 09 '16 at 18:38

0 Answers0