O
Oltmans
Hi, I hope you're doing well. I'm not an expert JavaScript programmer
and have few questions that I hope you can answer. I will really
appreciate any help.
1- My JavaScript code basically provides the user the ability to
perform certain actions (let's call them A(), B() and C()) after
login(). All these actions are happening asynchronously via Ajax. So
after writing this code here is how my code looks like
login()
A()
B()
C()
Problem is that login() is happening asynchronously(using Ajax) so I
never know when login() is done working and A()/B()/C() must only
execute after successful login(). But in my case, code first goes to
login() and while login() is still working the code jumps to B() hence
it's not working as desired.
In a nutshell, I want to provide the user ability to code like this
login()
A()
B()
but A() should only execute once login() is done working. Any ideas on
how to circumvent this situation? Please enlighten me. I will really
appreciate all help.
Thanks!
and have few questions that I hope you can answer. I will really
appreciate any help.
1- My JavaScript code basically provides the user the ability to
perform certain actions (let's call them A(), B() and C()) after
login(). All these actions are happening asynchronously via Ajax. So
after writing this code here is how my code looks like
login()
A()
B()
C()
Problem is that login() is happening asynchronously(using Ajax) so I
never know when login() is done working and A()/B()/C() must only
execute after successful login(). But in my case, code first goes to
login() and while login() is still working the code jumps to B() hence
it's not working as desired.
In a nutshell, I want to provide the user ability to code like this
login()
A()
B()
but A() should only execute once login() is done working. Any ideas on
how to circumvent this situation? Please enlighten me. I will really
appreciate all help.
Thanks!