Steve van Dongen wrote:[color=blue]
> On Fri, 25 Jul 2003 19:05:29 -0600, Chris Smith <cdsmith@twu.net>
> wrote:
>[color=green]
> >Been banging my head against this one for some time. I'm attempting to
> >use XmlHTTPRequest to read an XML document from the web server and
> >interact with it using the DOM. So far, I've had less than perfect luck
> >with IE. What I've established:
> >
> >- In IE, the responseXML property sometimes returns an empty document.
> >- It always does so when testing on local files.
> >- It (sometimes? always?) works fine when pages are served by a web
> >server.[/color]
>
> Maybe you're issuing async requests (good) but not waiting until the
> data is ready (bad).[/color]
Nah, using synchronous requests.
[color=blue][color=green]
> >Anything else to watch out for? Is there a workaround to force IE to
> >always parse the response text, even if it doesn't happen to guess that
> >the format is XML?[/color]
>
> It's not a matter of "guessing" the format because the content-type
> indentifies what the server is sending back. If you know better than
> the server, then use responseText instead of responseXml and do
> whatever you want with the data. You can also just forget about
> XMLHTTP completely and use a DOMDocument object's load(<url>) method.[/color]
Well, the server will always report text/xml as far as I know, but IE
seems to not work with local files, which makes it a bit difficult to do
exploratory testing. Aside from that, I've just seen this thing start
and stop working enough that I'm nervous about trusting it to work in
production. I *think* I can trace times when it hasn't worked to errors
in the returned XML content, but since I've seen empty DOM documents
when the XML is fine in some scenarios (at least with local files), I'm
being skeptical.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation