The stupid question is the question not asked | |
PerlMonks |
Re: jQuery issue with Dancer2by Corion (Patriarch) |
on Sep 23, 2016 at 05:24 UTC ( [id://1172404]=note: print w/replies, xml ) | Need Help?? |
This has nothing (nothing!) to do with Perl at all. If you eliminate the $.get call and replace it by something else that calls your callback, you will see exactly the same. Your aux_state function never returns a value, because it doesn't have a return statement:
The return statement you see is for the callback function that gets invoked asynchronously by jQuery. The aux_state function returns immediately and returns no value. To capture the return value of your $.get() call asynchronously in Javascript, you will have to pass in another callback to aux_state which then gets invoked once the value is available. This is what people name Callback Hell.
In Section
Seekers of Perl Wisdom
|
|