Michel Gutierrez wrote:
yes i was calling open from the onload callback of xmlhttprequest.
i throught xmlhttprequest.channel was there for getting the content only
and was not already opened.

It gets opened when you call send(). If you're in onload, that means that it's already finished loading and gotten closed. That's the only reason the open() call is not throwing; I'm not sure whether it should in fact throw (ccing .network on that).

What the channel _is_ there for is getting the response headers and configuring the channel _before_ you call send().

So you're basically making two requests to the server, in case you care.

i am now trying to get the content in an asynchronous way.

The point of XMLHttpRequest is to return the data as 1) a string and 2) a DOM. Since you want neither one, why are you bothering with XMLHttpRequest? Just create a channel and use it directly... In your OnStartRequest you can either set up a pipe, stick the data into it, and then in OnStopRequest parse with a DOMParser, or set up a stream to write to a file and write.

-Boris

-Boris
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to