[Project_owners] JavaScript Question

Jesper Staun Hansen jesper at heroes-addon.dk
Sat Nov 29 14:45:45 PST 2008


in the end of the function make a var ready = true, then in your main 
function you can have while(ready) wait_some_more;

joe ertaba wrote:
> Hi,
>
> I have a asynchronous function which need unknown time to answer
>
> var a = my_async_function("some inputs");
>
> var b = a + ....
>
>
>
> How can I use such functions ?
>
> My solution :
> I put rest of the code in a function and I ask my_async_function to 
> fire it after results are ready ! some thing like this:
>
> var a = my_async_function("some inputs", function(a){ b=a+... } );
>
>
> Any better idea ?
> ------------------------------------------------------------------------
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
>   



More information about the Project_owners mailing list