1

I just Trying to make an asynchronous project with XMLHttpRequest. it works well on other browsers but not working on Opera Mini Mobile Browser. now tell me how can I fix this. Code:

function runxml(){
  var xmlhttpr;
  var setup = document.getElementById("setup");
  if(window.XMLHttpRequest) {
    xmlhttpr = new XMLHttpRequest();
  } else {
     // for IE8 and Earlier
    xmlhttpr = new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttpr.onreadystatechange = function(){
    if(this.readyState == 4 || this.status == 200) {
      setup.innerHTML = this.responseText;
    }
  }
  xmlhttpr.open("GET", "file.txt", true);
  xmlhttpr.send();
}

0 Answers0