ok, thanks to everyone for the answers. I can now see why there is no
jQuery method to decode a JSON string: the eval is done implicitly,
since underlyingly, a script is requested when doing an Ajax JSON
request. Got that, and yes, if your source is trusted, then maybe
eval() is really the way to go, and it would probably be hard to
improve in terms of speed. The jQuery source for 1.2.3 does that
around line 2854, so that should be ok.

On the other hand, and contrary to my initial assumption, jQuery
apparently does not have any code to formulate a JSON query; the
$.ajax() method simply appends the data argument to the request URL if
data is a string, and turns it into a classical ?x=2&y=3 style query
string if data is a hash (an object). Means i must include additional
code (a plugin) to formulate JSON strings myself.

cheers everyone

_wolf

Reply via email to