Qooxdoo REST JSON request problem - unexpected token and then timeout

Posted by freiksenet on Stack Overflow See other posts from Stack Overflow or by freiksenet
Published on 2010-05-24T11:35:56Z Indexed on 2010/05/24 11:41 UTC
Read the original article Hit count: 354

Filed under:
|
|
|

Hello!

I am learning Qooxdoo framework and I am trying to make it work with a small Django web service. Django webservice just returns JSON data like this:

{ "name": "Football", "description": "The most popular sport." }

Then I use the following code to query that url:

var req = new qx.io.remote.Request(url, "GET", "application/json");
req.toggleCrossDomain();

req.addListener("completed", function(e) {
                 alert(e.getContent());
                    });
req.send();

Unfortunately when I execute the code I get unexpected token error and then request timeouts.

Uncaught SyntaxError: Unexpected token :
Native.js:91013011 qx.io.remote.RequestQueue[246]: Timeout: transport 248
Native.js:91013011 qx.io.remote.RequestQueue[246]: 5036ms > 5000ms
Native.js:91013013 qx.io.remote.Exchange[248]: Timeout: implementation 249

JSLint reports that this is a valid JSON, so I wonder why Qooxdoo doesn't parse it correctly.

© Stack Overflow or respective owner

Related posts about django

Related posts about JSON