Can anyone explain why this works in ie, but not firefox?
From editing this code and substituting alert statements, it seems that the readystate never gets past 1, but I don't see why.
function objConstruct(url,obj){
this.url=url;
this.lyr=document.getElementById(obj);
this.conn=createRequest(this);
}
function createRequest2(obj){
try {
obj.conn = new XMLHttpRequest();
}catch(trymicrosoft){
try{
obj.conn = new ActiveXObject("Msxml2.XMLHTTP");
}catch (othermicrosoft) {
try{
obj.conn = new ActiveXObject("Microsoft.XMLHTTP");
}catch (failed) {
obj.conn = false;
}
}
}
if (!obj.conn){
alert("Error initializing XMLHttpRequest!");
}else{
obj.conn.open("GET", obj.url, true);
obj.conn.onreadystatechange = function(){
if (obj.conn.readyState == 4){
if (obj.conn.status == 200){
obj.lyr.innerHTML+=obj.conn.responseText;
obj.lyr.style.width="98%";
obj.lyr.style.position="relative";
}
}
}
obj.conn.send(null);
}
}
var xmlhttp=new objConstruct("page.htm","layerID");
From editing this code and substituting alert statements, it seems that the readystate never gets past 1, but I don't see why.
function objConstruct(url,obj){
this.url=url;
this.lyr=document.getElementById(obj);
this.conn=createRequest(this);
}
function createRequest2(obj){
try {
obj.conn = new XMLHttpRequest();
}catch(trymicrosoft){
try{
obj.conn = new ActiveXObject("Msxml2.XMLHTTP");
}catch (othermicrosoft) {
try{
obj.conn = new ActiveXObject("Microsoft.XMLHTTP");
}catch (failed) {
obj.conn = false;
}
}
}
if (!obj.conn){
alert("Error initializing XMLHttpRequest!");
}else{
obj.conn.open("GET", obj.url, true);
obj.conn.onreadystatechange = function(){
if (obj.conn.readyState == 4){
if (obj.conn.status == 200){
obj.lyr.innerHTML+=obj.conn.responseText;
obj.lyr.style.width="98%";
obj.lyr.style.position="relative";
}
}
}
obj.conn.send(null);
}
}
var xmlhttp=new objConstruct("page.htm","layerID");