Where does jqXHR store decoded JSON?
I have a lot of code where I use $.post() to retrieve JSON data. I'm experimenting with Deferred objects, and can't figure out where done() gets the arguments that it passes to functions.
If I do something like this:
- var jqxhr = $.post('return_json.php');
- jqxhr.done( function(data){ echo data.return_val } )
...it works. jQuery decodes the JSON and passes the object to the anonymous function. But when I look at jqxhr's properties, I don't see the object. All I see is the responseText value, which is the original JSON text.
Does this mean the browser is decoding the JSON every time it runs a function via done()? I'm trying to decide whether I should store the decoded object somewhere, or have jQuery pass the object to every callback.