0

I have the following JQuery AJAX request, it works fine in Chrome but when I test in IE, it returns undefined:

$.ajax({
    url : 'http://pipes.yahoo.com/pipes/pipe.run?_id=26650603c42f41d78bfb5c5c740747d3&_render=json&_callback=?',
    dataType : 'xml',
    complete : function(data) {
        console.log(data.responseText);
    }
});
CallumVass
  • 11,288
  • 26
  • 84
  • 154

2 Answers2

1

Did you tried like this:

 $(document).ready(function(){
    $.ajax({
        url : 'http://pipes.yahoo.com/pipes/pipe.run?_id=26650603c42f41d78bfb5c5c740747d3&_render=json&_callback=pipeCallback', 
        dataType : 'jsonp',
        complete : function(data) {
            //alert(data.responseText);
            //console.log(data.value);
        },
         error: function (xhr, status, error) {
                alert(error);
            }
    });
});
function pipeCallback(d){
    data = d;
    //console.debug(d);
    var arts = d.value.items;
    for (var i=0; i<arts.length; i++)
    {
    var a = document.createElement("a");
    a.setAttribute("href", arts[i].link);
    a.innerHTML = "<h1>" + arts[i].title + "</h1>"
    var dv = document.createElement("div");
    dv.innerHTML = arts[i].description;
    document.body.appendChild(a);
    document.body.appendChild(dv);
    }   
}

Have just tested it is working fine also get rid of console.log calls, if the developer tools arenot open it wont work in IE.

Suave Nti
  • 3,721
  • 11
  • 54
  • 78
0

It seems it's a matter of browser security settings:

Internet explorer just doesn't allow CORS (at least in -IE7) as a matter of security. IE8+ seems to be able to do XDR, however.

Community
  • 1
  • 1
Joseph Szymborski
  • 1,241
  • 2
  • 17
  • 31