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

When running the code

$.getJSON('', function(data) {
    // Do some stuff here....

I get the error

Failed to load resource

Am I accessing this wrong?

share|improve this question
You're probably hitting some XSS blocks. – Kevin Montrose May 21 '10 at 22:17
@Kevin: So what should I do differently? – Lucas McCoy May 21 '10 at 22:25
up vote 9 down vote accepted

I suspect your problem (as I commented) is XSS related.

Try using JSONP instead of raw JSON; we just added support for the jsonp parameter.

share|improve this answer
uh, i thought it would not be supported on v1.0 API (i remember a dev.meta post about that), good! – systempuntoout May 23 '10 at 12:17
Sweet! Just what I needed. I suggest that the jsonp parameter be added to the global parameters list here – Greg Bray May 27 '10 at 19:52
Nevermind... I updated it. I keep forgetting everything is a wiki :-P – Greg Bray May 27 '10 at 20:02

As Kevin says, XSS. Try this instead:

$.getJSON("", function(data){
share|improve this answer

You must log in to answer this question.

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