Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your aux_state() function doesn't return any value. In case you didn't realize, in javascript, 'return' isn't implied like it is in Perl. If that is what you thought, then you also might be assuming that the return value from .get() is the same as the return value from your success function? But I didn't see any mention of a return value from .get() when reading the documentation that I found by searching for jQuery .get. If JavaScript didn't lack co-routines and so didn't force you into the fragmented code of call-back hell, then you could do something like:
And the nature of "call-back hell" infects all of the callers of your function so you probably just can't end up with something that would work for the code you wrote as:
You likely have to have yet another call-back that would get the fetched state passed to it. - tye In reply to Re: jQuery issue with Dancer2 (return)
by tye
|
|