Global Values Return To Original Values After Ajax (jquery)
I am relatively new to jQuery, I am trying to work around this code but constantly failing, the problem I'm facing is, I have a gloval array (Roles_Permission), I am able to use th
Solution 1:
Because AJAX request run asynchronously, which is why you are giving it a callback that will be called once it is done. Everything outside the callback will be executed right away even while the request you just sent is still running. This is why the bottom alert still has the old value, but the one inside the callback the new one.
Solution 2:
(source: fixingthesejquery.com)
Post a Comment for "Global Values Return To Original Values After Ajax (jquery)"