function PROT_NewXMLHttpRequest() {
  var Cc = Components.classes;
  var Ci = Components.interfaces;
  var request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
                .createInstance(Ci.nsIXMLHttpRequest);
  // Need the following so we get onerror/load/progresschange
  request.QueryInterface(Ci.nsIJSXMLHttpRequest);
  return request;
}
/**
 * Because we might be in a component, we can't just assume that
 * XMLHttpRequest exists. So we use this tiny factory function to wrap the
 * XPCOM version.
 *
 * @return XMLHttpRequest object
 */
Because we might be in a component, we can't just assume that
XMLHttpRequest exists. So we use this tiny factory function to wrap the
XPCOM version.


Because we might be in a component we can ' t just assume that XMLHttpRequest exists . So we use this tiny factory function to wrap the XPCOM version .
function PROT_NewXMLHttpRequest() {
  var Cc = Components.classes;
  var Ci = Components.interfaces;
  var request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
                .createInstance(Ci.nsIXMLHttpRequest);
  request.QueryInterface(Ci.nsIJSXMLHttpRequest);
  return request;
}
function PROT_NewXMLHttpRequest ( ) { var Cc = Components . classes ; var Ci = Components . interfaces ; var request = Cc [ "@mozilla.org/xmlextras/xmlhttprequest;1" ] . createInstance ( Ci . nsIXMLHttpRequest ) ; request . QueryInterface ( Ci . nsIJSXMLHttpRequest ) ; return request ; }
Because we might be in a component, we can't just assume that
 XMLHttpRequest exists.
Because we might be in a component we can ' t just assume that XMLHttpRequest exists .
// Need the following so we get onerror/load/progresschange