...

View Full Version : readyState 1



sybil6
02-27-2009, 12:40 PM
how can i get the an equivalent ready state 1 across those 3 brownsers:safari, ie,ff.
for ex: i have a simple "loading" string that shows up on readyState 1 but on safari it only shows after the second click over the ajax function, this features is crossbrowser if you use ajax with a library(jquery etc..) but what's the deal to make it cb using plain javascript?

A1ien51
02-27-2009, 03:05 PM
It would help if you showed your code.

Eric

sybil6
02-27-2009, 03:35 PM
bio=getXmlHttpRequestObject();
function _bio() {
bio.open("GET", 'bio.htm', true);
bio.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
bio.onreadystatechange = function() {
if(bio.readyState == 1){loader();}
if(bio.readyState == 4 && bio.status == 200){
document.getElementById("body_").innerHTML = bio.responseText;


}
};
bio.send(null);
};
for creating the xhr i use:


function getXmlHttpRequestObject(){
var xmlHttp=null;
try{xmlHttp=new XMLHttpRequest();}
catch (e){
try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum