Async load of JSON data in jQuery, just a little tip
We were a bit surprised that the html var didn't contain the json object, using contentType "json", after a little search I found that you have to use eval to get it to work. This is probably because you only get the json objec when it is parsed throgh the succes method. So the data comes in as string and the eval makes it a json object. Something like that.
var html = $.ajax({
url: "json.txt",
async: false
}).responseText;
alert( eval('('+ html +')').user );
[json.txt]
{
"user" : "wiibart", "password" : "secret"
}
Please reply if you have further insight or if you think I'm totally missing it here ;-)
You can use OAuth Twiiter authentication wich is cool.
