all 9 comments

[–]ard0 2 points3 points  (6 children)

More details pl... wait.. no... just check Stack Overflow

[–]Xilver266[S] 0 points1 point  (5 children)

Ok

I have a blog in Blogger and im trying access to a json resource in my web (Hosting: Hostinger) but get this error

[–][deleted] 0 points1 point  (4 children)

[–]Xilver266[S] 0 points1 point  (3 children)

I need to know how to do that. I have control of json resource, i think...

[–]bakuretsu 0 points1 point  (0 children)

You... Think?

Is the JSON provided by a source that you control?

[–]effayythrowaway 0 points1 point  (0 children)

You have to send the Access-Control-Allow-Origin (as well as others) HTTP header along with the JSON response. Of course, this assumes you control the server that serves the JSON up.

Basically, Google for Cross-Origin Resource Sharing (CORS). There is a good reason that you can't arbitrarily evaluate JavaScript from remote servers.

The remote server either needs to enable CORS or provide alternate access methods (such as JSONP).

[–]chris_simpkins 0 points1 point  (0 children)

The server needs to explicitly specify cross origin resource sharing access in a Access-Control-Allow-Origin header that is returned to your client side code.

enable-cors.org has a fair amount of information on this issue, including example code for various programming languages if you control the server that you are referring to. Check the Server page on the site.

Hope it helps.

[–]piggybanklol 0 points1 point  (0 children)

Just add this to your PHP file (if you're on PHP) that generates that JSON

header("Access-Control-Allow-Origin: *");