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:

  1. is onload , onerror same .done , .fail jquery?

  2. if not how can things based off success or fail response?

  3. basically if can me translate ajax call making xdr equivalent. appreciate help.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -