jQuery ready states

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waqasahmed996
    New Member
    • Jun 2008
    • 160

    jQuery ready states

    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
    Code:
    $.ajax({
       type: "GET",
       url: "abc.php",
       data: "usrid=1",
       success: function(msg){
    	 $('#abc').html(msg)
    
       }
     });
    Thanx
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    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

    Comment

    • waqasahmed996
      New Member
      • Jun 2008
      • 160

      #3
      my question is how i will check when state is 0 or 1

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        as i said ... i think you would need to hack into the jQuery request object ...

        Comment

        Working...