[jquery-dev] Re: how to get a asynchronous return value from a ajax callback

2008-10-23 Thread E. Myller
...or simply do a synchronous request. On Wed, Oct 22, 2008 at 10:00 PM, ricardobeat <[EMAIL PROTECTED]> wrote: > > This question should be asked at http://groups.google.com/group/jquery-en > I suppose. > > I assume you're doing something like: > > function(){ > //do something > if ( test() )

[jquery-dev] Re: how to get a asynchronous return value from a ajax callback

2008-10-22 Thread ricardobeat
This question should be asked at http://groups.google.com/group/jquery-en I suppose. I assume you're doing something like: function(){ //do something if ( test() ) // do something else } Just split it in two, and get the second part to be the ajax callback: function doSomething(){ //b

[jquery-dev] Re: how to get a asynchronous return value from a ajax callback

2008-10-22 Thread John Resig
I'm not sure what you're trying to achieve here since, by definition, you won't be able to return a value from an asynchronous interaction. The closest you could get would be to do: function test(){ var ret; $.ajax({ type: "POST", url:"/ajax/test/", data: { ...]