By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,253 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,253 IT Pros & Developers. It's quick & easy.

jQuery ready states

100+
P: 160
Hi,

we can show a image to show that processing is on in ajax.on the bases of ready states

Like the following


0 The request is not initialized
1 The request has been set up
2 The request has been sent
3 The request is in process
4 The request is complete

can we do this in jquery. i use following code
Expand|Select|Wrap|Line Numbers
  1. $.ajax({
  2.    type: "GET",
  3.    url: "abc.php",
  4.    data: "usrid=1",
  5.    success: function(msg){
  6.      $('#abc').html(msg)
  7.  
  8.    }
  9.  });
  10.  
Thanx
Feb 27 '10 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
is that a question? the code you showed just reacts when the readystate is 4 since it only adds a callback to the jQuery request object that should run on success. so what is the question? note: not all browsers fire all readystate-events ... so trying to hack into the jQuery request object might not give you the same result in all browsers ...

kind regards
Mar 2 '10 #2

100+
P: 160
my question is how i will check when state is 0 or 1
Mar 2 '10 #3

gits
Expert Mod 5K+
P: 5,390
as i said ... i think you would need to hack into the jQuery request object ...
Mar 2 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.