Issue with Chrome calling cross domain jsonp resource via jQuery ajax -


solved - adblock plus

i have cross-domain oauth scenario i'm calling oauth protected jsonp resources on 3rd party api directly javascript.

the client relies on server (the site of origin) generate signed request urls oauth resources on provider. client gets these oauth resources directly in attempt limit oauth proxy duties of server generating signed resource urls , letting js rest. here's js:

mynamespace = {     callapi: function(signedrequest, callback) {         $.ajax({             url: signedrequest,             datatype: "jsonp",             type: "get",             crossdomain: true,             jsonp: false,             jsonpcallback: callback,             cache: true,             async: true         });     },     userscallback: function(jsonp) {         alert(jsonp);     },     getoauthresource: function(resource, callback) {         $.ajax({             url: "/getsignedrequest?resource=" +  encodeuricomponent(resource + "&callback=" + callback),             success: function (signedrequest) {                 mynamespace.callapi(signedrequest, callback);             }         });     } } 

because parameter order matters when signing request, include callback manually gets ordered & included in signed request server generates.

so example usage simply,

mynamespace.getoauthresource("/users?id=1", "mynamespace.userscallback"); 

this working in firefox 20 , ie 10 - alert msg & expected json provider.

chrome 26 refuses perform cross-domain call provider. in dev tools, cross-domain resource shows status of "(failed)" , shows in console error.

if subsequently ask chrome open supposedly "failed" url in new window, re-requests url directly on provider , expected jsonp response:

mynamespace.userscallback({...}) 

why won't chrome perform cross-domain call?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -