I searched, many answers here. But I tried it all, It still does not work for me. I want to to get json
data from web service
(cross domain).
var url1 = 'http://localhost:33219/iSes/Pro/RfsPro.svc/GetPro/';
$.getJSON(url1,function(json){
alert('testing');
});
I got error from Chrome
console Origin null is not allowed by Access-Control-Allow-Origin
.
These are what I tried to do, by searching the answers here :
Put
/?callback=?
to url :var url1 = 'http://localhost:33219/iSes/Pro/RfsPro.svc/GetPro/?callback=?';
I found
chrome.exe --allow-file-access-from-files
but if we use this, do the clients that browse our website have to do it too?This answer, 3rd option related to
CORS
, usingPHP
to configure the header, How could I do this withajax
orjquery
? Because my project is usingbackbone.js
notPHP
.