tags:

views:

1556

answers:

3

Hello everyone,

I keep getting the following error's:

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://site/cms/js/interface.js :: doAjaxCall :: line 300" data: no]

 

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://site/cms/js/interface.js :: doAjaxCall :: line 300" data: no]

Line 0

This is the function with the doAjaxCall

function doAjaxCall(cmd,params) {
  var postdata='cmd='+cmd+'&params='+params;

  var a=sajax_init_object();
  if (a) {
    a.open("POST","ajax_handler.php", false);
    a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    a.send(postdata);                      <====Line 300
      document.body.style.cursor="default";

    if(a.readyState == 4) {
      return a.responseText;
    } else {
      alert("We where unable to execute the ajax call.");
    }
  }

function sajax_init_object() {
    var A;
    try {
     A=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
     try {
      A=new ActiveXObject("Microsoft.XMLHTTP");
     } catch (oc) {
      A=null;
     }
    }
    if(!A && typeof XMLHttpRequest != "undefined")
     A=new XMLHttpRequest();
    if (!A)
     alert("Could not create connection object.");
    return A;
}

Any idea's?

A: 

Is this going outside of your domain?

Are you using a relative url or absolute?

Daniel A. White
well the url's are built dynamic.
sanders
A: 

I have the same problem and going outside of my domain, can you help me?

mico
A: 

Due to security restrictions in Javascript, it is not possible to retrieve information from remote domains via an XMLHttpRequest. I think you need a proxy!

piero
Take a look here also: https://developer.mozilla.org/En/HTTP_Access_Control
piero