A few things. First of all, "Uncaught SyntaxError: Unexpected token :" means that the JavaScript javascript engine complains about the colon ":" , which was put in the wrong place.
The problem will most likely be in the returned JSON. Since everything returned by the server will be executed using the eval("{JSON HTTP RESULT}") function in javascript, it is most likely that your problem is somewhere there.
I put your code on a small sencha test harness and found a couple of problems with it.
First: My browser was not happy with "squiggly ã" in location: 'São+Paulo+-+SP', , so I had to change it to location: 'Sao+Paulo,+Brazil', , which worked and returned the correct results from the audioscribbler API.
Second:. I noticed that you added the callback: 'callback', to your request parameters, which changes the nature of the HTTP result and returns JSON as follows:
callback({ // a function call "callback(" gets added here "events":{ "event":[ { "id":"1713341", "title":"Skank", "artists":{ "artist":"Skank", "headliner":"Skank" }, // blah blah more stuff "@attr":{ "location":"Sao Paulo, Brazil", "page":"1", "totalpages":"1", "total":"2" } } }) // the object gets wrapped with extra parenthesis here
Instead, I think you should use callbackKey: 'callback' , which comes with an example at http://dev.sencha.com/deploy/touch/examples/ajax/index.js .
Something like this, for example:
Ext.util.JSONP.request({ url: 'http://ws.audioscrobbler.com/2.0/', params: { method: 'geo.getEvents', location: 'Sao+Paulo,+Brazil', format: 'json', api_key: 'b25b959554ed76058ac220b7b2e0a026' }, callbackKey: 'callback', callback: function(result) {
It worked for me like that, hope it works for you too. Cherio.