Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-27-2009, 12:40 PM   PM User | #1
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
readyState 1

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?
sybil6 is offline   Reply With Quote
Old 02-27-2009, 03:05 PM   PM User | #2
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
It would help if you showed your code.

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 02-27-2009, 03:35 PM   PM User | #3
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
Code:
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:

Code:
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;
}
sybil6 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:38 AM.


Advertisement
Log in to turn off these ads.