Question:
I'm trying to use JSON, but all i find is JSON parsers, which I don't need...
I've read that with JSON, you can do cross-domain requests.
but all I see is implementations that use XMLHttpRequest...
- which means you can't use cross-domain requests, at least not outside IE...
I've been on http://www.json.org/, but all I find is either parsers or useless.
The best I've found with google so far is
http://devpro.it/JSON/files/JSONError-js.html
but this is rather a mess, doesn't work cross domain, and intra-domain neihter - or rather not at all...
var the_object = {};
var http_request = new XMLHttpRequest();
http_request.open( "GET", url, true );
http_request.onreadystatechange = function () {
if ( http_request.readyState == 4 && http_request.status == 200 ) {
the_object = JSON.parse( http_request.responseText );
}
};
http_request.send(null);