In recent questions related to SPServices
- SPServices and GetListItemChanges
- rendering, spservices and view title header counts
- Display an Announcement List inside <div> tag
I see people use the
Is there an issue with the default async:true behaviour I need to become aware of?
or is this an example of people copy/pasting code without understanding what is going on?
By default, all of the Web Service operations are called asynchronously with AJAX. Generally, this will be the desired approach, but to force synchronicity, add the async: false option.
In layman's terms:
If you set
async:false your script will block processing of the rest of the page until the whole (SPservices) script has finished. Effectivly making the download/processing of the whole page a lot longer.
If you set
async:true (or leave out this line, because it is the default setting) your script will NOT block processing of the rest of the page until the whole (SPservices) script has finished.
So use false only when you really really need it.