I was just reading another question about jQuery\'s synchronous ajax call, and I got to wondering:
What circumstances make a synchronous version of an
synchronous ajax is often used to retrieve a valued from the server which is required to further continue processing of client side code. in such case, the ajax call will block until the call returns with the desired value. example:
a javascript function needs to compute salary for an employee: step1 : get the employee id from the form step2 : make a sync server call passing the emp.id to get his salary/hour step3 : multiply salary rate by number of working hours
as you can see, total salary cannot be computed unless the server call is finished so this should be a sync function, although if using jquery, one could handle onSuccess to compute the salary asynchronously but processing will continue in this if you have a message box to display the salary, it will appear empty...