News:

Tekforums.net - The improved home of Tekforums! :D

Main Menu

anyone any good with AJAX?

Started by bytejunkie, October 03, 2006, 13:37:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shofty

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

Sam

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.

shofty

so build a comma separated string, then pass it backwards with echo?

thanks Sam.

Matt

Serious

And I thought you were needing someone to clean the bath :(

Sam

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).