• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gloabal variable value not assigning

 
Sridhar Ranganthan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

global variable value is not assiging during asynchronous call.


consider the below ex




Thanks,
sri.R
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the request is asynchronous. Line 10 executes after the request is made but it's not going to wait for the request to complete so the variable has yet to be updated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic