Skip to content Skip to sidebar Skip to footer

Having Trouble Getting A Return Value From A Javascript Callback

Hey everyone - I'm having some difficulties properly getting a return value from one of my Javascript callback functions, and it looks to be dependent on a race condition, but I'm

Solution 1:

Pass the defined function to your ajax call (I am assuming that is an ajax call) or pass it as an anonymous lambda. Your callback function is created on the fly after the call that passes it.

Solution 2:

You cannot make your function block until the callback finishes without completely freezing the browser, which is not a good idea.

You need to make your getName function take a callback and give the callback its value, just like companyfn.app.getInfo.

Post a Comment for "Having Trouble Getting A Return Value From A Javascript Callback"