Why am I seeing a Access-Control-Allow-Origin error?

The "not allowed by Access-Control-Allow-Origin" message indicates an AJAX request being blocked by the browser/sandbox for security purposes. This can be bypassed by using our "jsonp" end-points (simply replace "json" with "jsonp" in the REST request). Note that the result is in the form of a javascript function call -- the name of which can be specified using an optional parameter "callback". Here is an example JSONP invocation:

https://api.flightstats.com/flex/airports/rest/v1/jsonp/fs/PDX?appId=[ID]&appKey=[KEY]&callback=airportResult

Here is some further reading on the subject: 
http://stackoverflow.com/questions/10143093/origin-is-not-allowed-by-access-control-allow-origin 
http://en.wikipedia.org/wiki/JSONP

Have more questions? Submit a request

0 Comments

Article is closed for comments.