oops! 'foo' should be 'processJsonPart'
On Thu, Jul 9, 2009 at 1:38 AM, Douglas<douglas.gont...@gmail.com> wrote: > Hello, > all you have to do (I guess) is set a callback to onComplete. > Something as follow: > > // onComplete callback's call > function processJsonPart (myCoolVar) > { > // do something with your returned JSON > return myCoolVarEvaluatedOrValidatedOrAnythingYouWant; > } > > // here we call Ajax.request > function clickButtonExample() > { > new Ajax.Request(url, { > onComplete: function(r) > { > var json = r.responseText.evalJSON(true); > $('name').value = foo(json.name); > } > } > } > > PS: untested functions. > > On Wed, Jul 8, 2009 at 11:37 PM, chrysanthe m<chrysant...@gmail.com> wrote: >> Hi David >> Thanks, but I think I one step further. I am assuming an Ajax.request() has >> happened, returned and what I am looking at to understand further is syntax >> like this: >> $('fullName').value = json.fullName; >> for an returned parameter fullName and an html element ID of fullName. I am >> wondering, can I do >> $('fullName').value =processMe( json.fullName); >> which I know the obvious is try it. I will, just trying to get an heads >> up. I will report back. Also I am assuming that prototpye is processing >> that nomenclature $('fullName') segment and just doing a >> document.getElementById. Any insight appreciated. >> >> On Wed, Jul 8, 2009 at 12:25 PM, David Behler <d.beh...@gmail.com> wrote: >>> >>> I guess you would have to use Ajax.Request to process the returned >>> value before updating the designated element. >>> >>> But I'm beginner and could be wrong here. >>> >> >> >> >> >> > > > > -- > Believe nothing, no matter where you read it, or who said it, no > matter if I have said it, unless it agrees with your own reason and > your own common sense. > -- Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---