I'm having a problem, my code works in XAMPP. However, it is not working once I put it in the server, I host it with fatcow, it seems that they work json and php 5.2.
I'm using Jquery and Json, two commands I'm using to retrive the data $.getJSON and $.post, I'm using two libraries src="http://code.jquery.com/jquery-latest.js" type="text/javascript"> jquery.json.js
I have no clue what is the problem, the json encode outputs json data, but my code from js doesn't retrive it doesn't seem that it copies to the array i have with $.getJson. I dont understand, all help will be greatly appretiated.
Looks like your JSON data is not returned due to the Cross Origin Resource Sharing policy (CORS).
You can solve this problem by:
OR
By adding the header:
Access-Control-Allow-Origin: *
to your JSON file.
More information on how to add CORS headers
Hope that helps :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.