View Single Post
Old 06-14-2007, 01:59 PM   #1 (permalink)
Vormund
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default AJAX ... Javascript - XMLHttp Objects - Getting the XML responses...

Has anyone dealt with this? I'm making a simple "shout-out" type form on my website, and so far have it successfully posting / querying, but getting the results is another story.

This is an example of what is returned to the XML HTTP Object (XHO):
Code:
<xmlresponse>
  <msg>sdfsadf</msg>
  <msg>hmm</msg>
  <msg>sdfsdf</msg>
  <msg>hmm?</msg>
  <msg>blarg</msg>
</xmlresponse>
Using this on the response:
Code:
document.getElementById( "test" ).innerHTML = XHO.responseText;
My <div id="test"></div> displays the output like the above, so I know it's working...response-wise. But the nice thing about this is the XML parser that should make it easy. As I understand it, this:
Code:
alert( XHO.responseXML.getElementsByTagName( 'msg' )[0].data );
Should display "sdfsadf" since it's the first element...but if I do anything with
Code:
XHO.responseXML.getElementsByTagName( 'msg' )[0].data
as a part of it, the Javascript seemingly terminates / or whatever it does it never finishes.

Any ideas?
__________________
Vormund is offline