Are you *sure* you want to do this?

It locks up the browser completely - and all other browser windows in many
browsers - until the ajax call returns.

If it's just a matter of coding convenience, balance that against the
inconvenience it will cause your visitors if the site is slow to respond.

Or is there another design reason why you need the synchronous call?

-Mike

> From: James Dempster
> 
> worked it out guys, silly me it's loading data synchronously 
> instead of asynchronously. Done by doing...
> 
> function test() {
>   var html = $.ajax({
>    url: "some.php",
>    async: false // <-- heres the key !
>   }).responseText;
>   return html;
> }
> 
> :-) thanks all
> 
> > I'm looking for something that will wait inside the 
> > function until it has the data to return, so not the
> > callback type system that currently exists.
> > Something that will mimic this type of stuff will do too.
> >
> > e.g.
> > function test() {
> >   $.ajax stuff here
> >   return data; // return data from the ajax request
> >
> > }
> >
> > var bler = test();

Reply via email to