Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently, the only way to call the API from javascript is to use JSONP, but this can be cumbersome and has security issues. If the following header was included in all API responses, the API could be called through javascript in most browsers:

Access-Control-Allow-Origin: *

See this for more information. Similar features have already been enabled in Flash and Silverlight, and doing the same for javascript would be useful.

share|improve this question
Just out of curiosity... which browsers currently support this? – Nathan Osman Jul 17 '11 at 19:15
@George Edison: – Gelatin Jul 17 '11 at 19:35
Cool. I would love to see this implemented. – Nathan Osman Jul 19 '11 at 6:32
up vote 6 down vote accepted

API V2 did this, we send down:

Access-Control-Allow-Credentials: false
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Origin: *

With every response.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .