javascript - JQuery ajax cross domain call and permission issue -
I have this voting script to check that the text file is created on the server or not. Works great locally, but when there is a file on a different domain, it fails to cross domain support, how do I rewrite it?
$ Ajax ({url: 'http://blah.mydomain.com/test.txt', type: "GET", success: work (results) {// success! Window. location (successful .expx) ;}, Error: Work (Request, Status, Error) {setTimeout ("VerifyStatus (" + pollingInterval + ")");}});
Edit: I ended up using YQL to resolve the cross domain issue and although it works, YQL is actually slowing down a bit of performance overhead Adding Any cross domain recommend better solution for JQuery calls?
Write the data type "JSONP" on your call. You must make sure that the response to the work has been formatted properly. There is a good section of Wikipedia.
Comments
Post a Comment