I'm having some difficulties with AJAX. I am trying retrieve a list of elements (many elements ) via XMLHttpRequest. The request is posted to a Java Servlet which composes a XML file and sends it back. Although I specified the responseXML is empty. It worked fine with responseText and the content type set to "text/html". Here's my code as an example:
Can't say for sure whether this will help, but _sometimes_ the client-side routines for parsing responseXML barf silently if the content isn't correctly formed. There have been two approaches I've used to identify and solve this:
1) on the server, write out the complete contents that you're outputting (for example, using System.out.println) then copy that from your server output log to an XML validator.
2) on the client, pick up the results NOT as responseXML, but as responseText(), then issue a client-side alert() -- copy the contents of the alert box to an XML validator.
Typically if I run into the problem you describe it's because of some unexpected flakiness in my data: for example, an ampersand or angle-bracket inside one of my data elements, or some other bizarre data anomaly.