nsIJSXMLHttpRequest

IID:9deabc90-28d5-41d3-a660-474f2254f4ba
Inherits From:nsISupports

Properties

nsIDOMEventListener onerror

Meant to be a script-only mechanism for setting an error event listener. The attribute is expected to be JavaScript function object. When the error event occurs, the function is invoked. This attribute should not be used from native code!!

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Mozilla only.

nsIDOMEventListener onload

Meant to be a script-only mechanism for setting a load event listener. The attribute is expected to be JavaScript function object. When the load event occurs, the function is invoked. This attribute should not be used from native code!!

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Mozilla only.

nsIDOMEventListener onprogress

Meant to be a script-only mechanism for setting a progress event listener. The attribute is expected to be JavaScript function object. When the error event occurs, the function is invoked. This attribute should not be used from native code!! This event listener may be called multiple times during the open request.

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Mozilla only.

nsIOnReadyStateChangeHandler onreadystatechange

Meant to be a script-only mechanism for setting a callback function. The attribute is expected to be JavaScript function object. When the readyState changes, the callback function will be called. This attribute should not be used from native code!!

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
May 3, 2005, 4:10 am neil dot stansbury at redbacksystems dot com
There is also an onprogress() method available to scripts like the onload()/onerror() methods. This method passes an XMLHttpProgressEvent as the argument rather than the nsIDOMEvent object thus:

var loadProgress = {
handleEvent: function( event ) {
dump( "\n" +event.position +" of " +event.totalSize +" bytes" );
}
}
httpRequest.onprogress = loadProgress;

For all the gory details checkout: http://lxr.mozilla.org/mozilla/source/extensions/xmlextras/base/public/nsIXMLHttpRequest.idl

Copyright © 1999 - 2005 XULPlanet.com