...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() )
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
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: { ...]