jquery - Cross domain calls IE8 & IE9 -
i making various cross domain ajax calls various endpoints. works fine in chrome, firefox , ie 10 , 11 not working in ie8 , ie9. getting following error in console:
[object object]{readystate: 0, status: 0, statustext: "no transport"}
the ajax code using following:
$.getjson(url).done(function (data) { console.log(data); //do stuff based on response }).fail(function (data){ //do stuff based on response });
i have tried adding following due others saying might work:
$.support.cors = true;
however still receiving same error.
i have read ie8 , ie9 not support ajax calls , need use xdr.
i have tried not having luck following code tried:
var xdr = new xdomainrequest(); xdr.onload = function () { console.log(xdr.responsetext); } xdr.onerror = function () { /* error handling here */ } xdr.open('get', url); xdr.send();
however, not working either. possible doing wrong since have never worked xdr before.
the console.log outputting following:
<!doctype html> <html lang="en-us"> <head> <title>subscriberexists snapshot of 6/13/2015 12:12:22 am</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style type="text/css">
so, guess have few questions:
is onload , onerror same .done , .fail jquery?
if not how can things based off success or fail response?
basically if can me translate ajax call making xdr equivalent. appreciate help.
Comments
Post a Comment