Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AbhijitBansode
Specialist
Specialist

Unable to execute Send on XMLHttpRequest

//create xmlhttp object for relevant browser type

  try{

  //older versions of IE

  xmlhttp = new ActiveXObject("microsoft.xmlhttp");

  }

  catch(e){

  //all other browsers

  xmlhttp = new XMLHttpRequest();

  }

  //create xml to be submitted over xmlhttp

  var sXML = "<xml key='Test' action='save'><Id>"+Id+"</Id><UpdatedBy>"+userid+"</UpdatedBy><Amount>" + newamnt + "</Amount></xml>";  

  try

  {

  xmlhttp.open('POST', sURL, false);

  xmlhttp.send(sXML);  

  var sResponse = xmlhttp.responseText;

  document.getElementById("result").innerHTML =sResponse;

  }

  catch(e)

  {

  document.getElementById("result").innerHTML = e.message;

  }

This code is present in the extension object which submits data to ASP page at specified URL. sURL in this case. This is working fine with internet explorer but throwing the error "Filed to execute Send on XMLHttpRequest" on google chrome. Can anybody point me right direction to resolve this. Thanks.

5 Replies
oleg_orlov
Creator
Creator

Hi, Abhijit!

I faced the same problem. Did you find the solution?

try {

  var xhr = new XMLHttpRequest();

  xhr.open("GET", "http://www.qlik.com/", false);

  xhr.send(null);

  if (xhr.readyState === 4) {

    if (xhr.status === 200) {

      console.log(xhr.responseText);

    }

  }

} catch (e) {

  console.error(e);

}

Best regards,

Oleg Orlov

sgrice
Partner - Creator II
Partner - Creator II

Sounds like Manifest security issue

add

   "http : //*/*",

   "https : //*/*",



to the permission [Without the spaces]

oleg_orlov
Creator
Creator

Hi, Steven! Thank you for reply.

Can you explain the solution in details?

sgrice
Partner - Creator II
Partner - Creator II

The manifest file controls cross Server/WEB security so you need to tell it which sites are ok. those 2 lines make all site ok to use.

The manifest file should be at the root of your WEB in IIS.

sgrice
Partner - Creator II
Partner - Creator II

Actual I believe the issue you are haing is the way chrome wants you to use XMLHttpRequest

This link explains better than I

Getting Rid of Synchronous XHRs — Web Updates