Works wonderfully, But, is there a built in way to make all results returned from an XHR request as valid JSON, without me using decode in several places?
On Mon, Feb 23, 2009 at 3:51 PM, Jeremy B <[email protected]> wrote: > I believe you want to use JSON.decode(str); > See the docs here: > http://mootools.net/docs/Utilities/JSON > > Jeremy Bueler > www.jbueler.com > > > > On Mon, Feb 23, 2009 at 12:46 PM, Itay Moav <[email protected]>wrote: > >> Hi, >> >> I have a form submitted: >> Form.set('send',{'onSuccess':function(responseText, responseXML){ >> >> alert(responseText.data); >> >> } >> }); >> Form.send(); >> >> >> The responseText is "{'data':10}" >> So, what should I do (beside using an eval) to make >> alert(responseText.data); echo 10? >> Right now, it is "undefined". >> The request returns with the correct data. >> > >
