update variable after success of ajax function

Posted by Scarface on Stack Overflow See other posts from Stack Overflow or by Scarface
Published on 2010-04-30T21:00:27Z Indexed on 2010/04/30 21:07 UTC
Read the original article Hit count: 160

Filed under:

Hey guys quick question, I am sending a request with the jquery ajax function with a variable. After the request I want that variable updated to match the value of the sent back information, so next time the ajax function executes, it send the value of the new variable.

$.ajax({
   type: "POST",
   data: "countusers=" + countusers,
   url: "tester.php",
    dataType: 'json',
   success: function(json)
   {
var countusers=json.rownumber;
}   
}
})

© Stack Overflow or respective owner

Related posts about jQuery