|
|
 |
 |
 |
 |
Javascript / Client Side Development
|
 |
 |
 |
 |
 |
 |
 |
 |
Using Response XML
Is there an easy way to use responseXML w/o recreating the tags. I've tried taking tags that are returned from the responseXML and appending them to other tags in the document but then I have no luck accessing the properties of the elements from the responsexml. Thanks
On May 23, 4:50 pm, Mister Joe <mrjoefri@gmail.com> wrote: > Is there an easy way to use responseXML w/o recreating the tags. I've > tried taking tags that are returned from the responseXML and appending > them to other tags in the document but then I have no luck accessing > the properties of the elements from the responsexml.
I believe the easy and only way to use the stuff in responseXml is by adding it to some preset element, assuming your user agent is ok with innerHtml. This is based on the lack of response I got to the similar quesiton I asked at the end of the following thread, not long ago: http://groups.google.com/group/comp.lang.javascript/browse_frm/thread... HTH, F.O.R.
On May 24, 9:50 am, Olorin <francesco.ri@gmail.com> wrote: > On May 23, 4:50 pm, Mister Joe <mrjoefri @gmail.com> wrote: > > Is there an easy way to use responseXML w/o recreating the tags. I've > > tried taking tags that are returned from the responseXML and appending > > them to other tags in the document but then I have no luck accessing > > the properties of the elements from the responsexml. > I believe the easy and only way to use the stuff in responseXml is by > adding it to some preset element, assuming your user agent is ok with > innerHtml. > This is based on the lack of response I got to the similar quesiton I > asked at the end of the following thread, not long ago:http://groups.google.com/group/comp.lang.javascript/browse_frm/thread...
If you are using XML, you can create an XML document object and then use DOM Core methods to deal with it. This recent thread shows how: <URL: http://groups.google.com.au/group/comp.lang.javascript/browse_frm/thr...
However, that is only good for getting the data out and using it in the HTML document, I don't think you can just grab XML DOM elements and drop them into an HTML document. So given that the XML document becomes just a data transport, JSON becomes the obvious choice because it is simple to generate a javascript object and work with it, no XML support required. It is also kind of XML-ish. The idea of using innerHTML is so you can send HTML and just drop it into the document. Also, a number of libraries allow you to use DOM- like manipulation (insert, append, wrap, etc.) using HTML strings rather than DOM objects. -- Rob
|
 |
 |
 |
 |
|