[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: [OT] using ajax
OFF-TOPIC On 11/6/06, Diana Castillo <diana@h...> wrote: > > > Any ideas how to use ajax to have a form submit send an xml, process it and > show it on the same page? > using php? Well... you can replace the submit button for a onclick button <input type="submit" value="Send"> to this <input type="button" value="Send" onclick="SendDataTroughAjax()"> this function SendDataTroughAjax need to read the .value of the form fields and build a POST response with url the form action. The server side response (the PHP stdio output) can be the new data to render. The data can be XML, Json, text or urlcoded. Json is directly useable as JS objects, while on XML you need to walk the tree* or request for elements by id. Using text as in like CSV is hacky. With the data the server return (XML,json, text, urlencoded params,etc) you rebuild the html tree trough DOM api methods, or do a fast & ugly .innerHTML. But innerHTML is not XML friendly, so you will avoid him on XHTML. *: Maybe you can avoid that, maybe you can directly create a dom tree from the xml tree and style it. Theres a few automagically steps to do here, but XML is design to able automagic everywhere.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|