Tekforums

Chat => Entertainment & Technology => Topic started by: shofty on October 03, 2006, 13:37:21 PM

Title: anyone any good with AJAX?
Post by: shofty on October 03, 2006, 13:37:21 PM
anyone any good with AJAX? I need to know how to pass an array back into the presentation layer so i can fill out the form...

Im going from a php function which collects information from mySQL back to my JS to fill out my form.

do i just echo the array?

Matt
Title: anyone any good with AJAX?
Post by: Sam on October 03, 2006, 21:44:34 PM
You cant pass an array through Ajax. You can send back Strings only - obviously its just a HTTP request despite all the nonsense surrounding it.

Just pass the data back however you want to do it, comma delimited or something.
Title: Re:anyone any good with AJAX?
Post by: shofty on October 03, 2006, 21:58:47 PM
so build a comma separated string, then pass it backwards with echo?

thanks Sam.

Matt
Title: Re:anyone any good with AJAX?
Post by: Serious on October 03, 2006, 23:30:20 PM
And I thought you were needing someone to clean the bath :(
Title: Re:anyone any good with AJAX?
Post by: Sam on October 04, 2006, 19:32:25 PM
Quote from: bytejunkieso build a comma separated string, then pass it backwards with echo?

thanks Sam.

Matt

thats one way, and probably a common one. Or build an XML snippet (OTT IMHO).