Hi,
I'm trying to use jQuery.getJSON to get data from a domain I don't own myself. I've made it work in the past, but this time it keeps failing. I get the response into the browser, but then Chrome says SyntaxError: Unexpected token :
and Firefox says invalid label
.
There are a few peculiarities with this. Say the code is MY_JSON_RESPONSE (not a variable, just an "alias"). These both return the expected objects:
a = MY_JSON_RESPONSE;
eval(MY_JSON_RESPONSE);
This is the request I make:
$.getJSON("http://xxx.yyy.zzz/abc?callback=?",
function(data) {
console.log(data);
});
EDIT: Below is the anonymised response data:
{"aaaaaaa":"aaaaaaaa aaaaa aaa aaaaaaaaaa","aaaaa":"aaaaaaaa aaaaa aaa","aa":"0000000","aaaa_aaaaaaa":"aaa aaaaa","aaaaaaa_aaaaaaa":"aa aaa aaaaaaaa aa aaaaaaaa aaa aaaaaaa aaaaaa aaa aaa aaaaaaaa aa aaaaaaaa aa aaaaaa aaaaa aaa aaaaa. aaa aaaaaaaa aaaaa aaa aaaaaaaaaa aaaaaaaa aaaaa aaaaa aaaaaaaa aaaaaaaaaaa aaaaaaaaaa aa aaaa 00 aaaaaaa aaaaaaaaa aa aaa aaaaaaaa aaaaa aaa, aa aaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaa, aaaaaaaaa aaa aaaaaaa aaaaaaaa. 00% aa aaaaaaa aaaaaa aaaaa aaaaa aaaaaaaaaaaaa aaaaa aaaaaaaaaaaaa.","aaaaaaaaa":[{"aaaaaa":"aaaaa aaa aaaaaa aaaaaaaa","aaaaaaa":"aaaaaaaa aa aaaaaa aaa aaaa","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a00.00"},{"aaaaaa":"aaa","aaaaaaa":"aaaaaaaa aaaa aa &aaaa;aaaaa aaa aaaaaaaaaa aaaaaaaaa&aaaa; - aaa aaa aa, aaaaa aaa a aaaa aaaaa!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a000.00"},{"aaaaaa":"aaaaa","aaaaaaa":"aaaa aaaa aaaa!!!!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a00.00"},{"aaaaaa":"aaa\/aaa","aaaaaaa":"aaaaaaa aaaaa aaaa aaa aaaa aaaaa aaa aaaaa aaa aaaaaaa aaaa!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaaaaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aa (aaaaaaa &aaa; aaaaaaaaa)","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a0000.00","aaaa_aaa":""},{"aaaaaa":"aaaaa aaaaaaaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a00.00"},{"aaaaaa":"aaaaaa aaaaaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"","aaaa_aaa":""},{"aaaaaa":"aaaaaa aaaaaaaa","aaaaaaa":"aaaa aaaaaaa aaaaaaaaa","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaa aaaaaaaaaaa","aaaaaaa":"aaaaa aaaaaa�a aaa, aaa! aaaa aaaaaaaa aa aaa aaa! :-) --aaa","aaaa":"00\/00\/00","aaaaaa":"","aaaa_aaa":""},{"aaaaaa":"aaaaaa aaaa - aaaaaaaa aaaaaa aaa","aaaaaaa":"aaaaaa aa aaa aaa aaaaaaaa aaaaa aaaaaa aa aaaa aa aaa aaaaa aaa aaaaa. aaaa aaaa aaaaaa aaaaaaaaa !!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaa aaaaaaaaa","aaaaaaa":"aa aaaaaa aaaa aaaaaaaa aa aaaa aa aaaa aa a aaaa aaaaa aaa aaaaaaaaaa. aaaa aa aa aaaaaa aa a aaaa aaaaa.","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaaaaa aaa aaaaaaaaaaa aaaaaaa aaaaaa","aaaaaaa":"aaaaa aaaaa. aaaa aa aaa aaaaaa aaaaaaaaa!!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaa aaaaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a00.00"},{"aaaaaa":"aaaaaaaaa aaaaaa","aaaaaaa":"aaaaaaa aaa aaaa aaaaaa�a aaaaaaaaa aaaa","aaaa":"00\/00\/00","aaaaaa":"\u00a0000.00","aaaa_aaa":"\u00a000.00"},{"aaaaaa":"aaaaaaa aaaaaa","aaaaaaa":"aaaaaaaaa aaaaa, aaa! aaaaaaa &aaa; aaaaa","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a00.00"},{"aaaaaa":"aaaaa aaaaaaaa","aaaaaaa":"aaaaaaaa aaaaaaa - aaaaaaa aaaaaaaaa a aaa aaa aaaaaa!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaa aaaaaa","aaaaaaa":"aaaaaaaaaaaa - aaa!","aaaa":"00\/00\/00","aaaaaa":"\u00a0000.00","aaaa_aaa":""},{"aaaaaa":"aaaaa aaaaaaaaaaa","aaaaaaa":"aaaa aaaa!!!","aaaa":"00\/00\/00","aaaaaa":"\u00a00.00","aaaa_aaa":""},{"aaaaaa":"aaaaa aaaaaaa","aaaaaaa":"aaaa aaaa aaaaa, aaaaaaa, aaaaaaa, aaaaa, aaa, aaaa, aaa, aaaaaaaa, aaaa, aaa, aaaaa, aaa, aaa, aaaaa, aaa, aaaa, aaaa, aaaa, aaaaa, aaa, aaaaaaaa","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaaaa aaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaa aaaaaa","aaaaaaa":"aaaa aaa aa aa aaaa aa a aaaaaaa aa aaaaa! aaa aaa aaaaa!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaaa aaaaaaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaa aaaaaaaa","aaaaaaa":"aa aa aa! :)","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaa aaaaaaaaa","aaaaaaa":"aaaa a aaaaaa aaaaaaaaa aaaa aa aa aaa :)","aaaa":"00\/00\/00","aaaaaa":"","aaaa_aaa":""},{"aaaaaa":"aaa-aaaaaaa aaaaaaaa","aaaaaaa":"aaaa aaaaaaaa aa aa aaa aaaa aa aa aaaaaaaaaaa, aaaa a. aaaaaaaa","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaaa aaaa","aaaaaaa":"","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaaaaaa aaaa","aaaaaaa":"a aaaaaaaa aa aaa aaaaaaaa aaaaa aaa aa aaaaa aa aaaaa aaa aaaaa aaaaa aa aaa aaaaaa aa aaaaaaaaa.","aaaa":"00\/00\/00","aaaaaa":"","aaaa_aaa":""},{"aaaaaa":"aaaaaaa aaaaaaa","aaaaaaa":"aaaaa aaaaaaaa aaa aaaa aaaaaaa aaaa aaaaaa aaa!","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":""},{"aaaaaa":"aaa aaaa","aaaaaaa":"aaaa aaaa aaaa aaaa aaaaaaaaaaa aaaa aaa aaa aaaaaaaaa aaaa aaa aa","aaaa":"00\/00\/00","aaaaaa":"\u00a000.00","aaaa_aaa":"\u00a00.00"}],"aaaa_aaaaaaa":"","aaaa_aaa":"\u00a0000.00","aaaaaaaaa_aaaaaa":"\u00a00,000.00","aaaaaaaaa_aaaaa":"\u00a00,000.00","aaaaaaa_aaaa":"aaaa:\/\/aaa.aaaaaaaaaa.aaa\/\/aaaaa\/aaaaaaa.aaaa?aaaa=aaaaaaa&aaaaaaaaa=aaaaaaaaaaa&aaaaa=000&aaaaaa=000&aaa=aaaa_aaaa0.aaa","aaaaaaaaa_aaaaaa":"\u00a00,000.00","aaaaaaaaa_aaaaaaa":"\u00a00.00","aaa_aaaaaa":true,"aaaaaaaaaa_aaaaaaaa":00}
I'd like to avoid having to do it on the server on my own domain, to minimise server load.