I need to access a json object in javascript with the following strucure:
jsonp1354291250080({
"query":{"count":"1","created":"2012","lang":"en"},
"results":["this is a test"]
});
I’m receiving this object from an online service, I cannot control its structure and using data.query is not working.
Please if someone knows how to access it.
UPDATE: I’m using jquery.xdomainajax.js of James Padolsey https://github.com/padolsey/jQuery-Plugins/tree/master/cross-domain-ajax/
and using $.get() function of jQuery to do cross-domain requests
You’re using a JSONP service since you are on a different domain. Your best bet is to let jQuery’s $.getJSON handle it for you.
The JSONP example on that page: