I\'m sure you know this problem, I\'m still trying to solve it for few days. I\'ve tried lots of stuff but no one worked:
Here is the code
function l
The problem here is that AJAX is asynchronous (it's what the first A stands for). This means that the function returns immediately; the success
handler is only called when the request is successful. This means that lobbyLeader
returns immediately after you have made your request, so returns nothing.
If you have any code that needs to run after you have received the data, it must be placed in the success
handler (or another AJAX event handler) or be invoked by it.