Общий ситаксис таков:
$.ajax({ type: 'POST', url: url, data: data, success: success, dataType: dataType, async:false // будем выполнять синхронно });