I have a problem with JSON query.
I research on the forum and a lot of other websites to find how to fix the problem, but I used probably all of the options to repair my script...
At the moment my script:
jQuery.ajax({
url: "http://target.xyz/?f=json",
dataType: 'JSONP',
jsonpCallback: 'callback',
type: 'GET',
success: function (data) {
console.log(data);
}
});
Before the script, I use normal JSON but I saw:
XMLHttpRequest cannot load http://target.xyz/?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mypage.xyz' is therefore not allowed access.
When I use JSONP on my target website, I get data but website returned:
one error Uncaught SyntaxError: Unexpected token :
Response data:
{
"date" : "2017-05-29",
"gold" : "1267.00",
"silver" : "17.39",
"platinum" : "956.05"
}
Please give me some advice or links. Thanks.
</div>