[jQuery] Return value instead of callback?
Hi!
I want to get a value from jQuery.get() and I want the function (in
the example called getFromServer()) to wait until the server has
loaded the value (not the normal multithreaded way with a callback).
I've tried to use the callback to set a global and the script to wait
until the global is set, but I can't get it to work.
This is what I want:
serverValue = getFromServer("test.php");
if(serverValue == "foo")
{
...
}
Is this somehow possible?
Thanks a lot.