Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [OT] using ajax

From: Tei <oscar.vives@-----.--->
To: "XML Developers List" <xml-dev@-----.---.--->
Date: 11/8/2006 8:17:00 AM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent