AJAX is Asynchronous Javascript and XML
SJAX is Synchronous Javascript and XML
What does Asynchronous means ? It means that when a request is sent to the server the statements following (javascript code OTHER than the callback function ) are executed WITHOUT waiting for the server response. So even though if your server is taking a long time for responsing for a request , you are not put on a hold. That's the beauty of AJAX.
Synchronous means here exactly the opposite of it. That means you force the browser to wait for the server response. This might be a bit a dangerous step because if the server takes a long time,the browser may appear dead. Your users might have to close the tab or the browser.
How to send Synchronous request by jQuery?
$.ajax method of jquery supports a lot of options , there is an option called
async which is true by default . You can set it to false. You can find it here
SJAX is Synchronous Javascript and XML
What does Asynchronous means ? It means that when a request is sent to the server the statements following (javascript code OTHER than the callback function ) are executed WITHOUT waiting for the server response. So even though if your server is taking a long time for responsing for a request , you are not put on a hold. That's the beauty of AJAX.
Synchronous means here exactly the opposite of it. That means you force the browser to wait for the server response. This might be a bit a dangerous step because if the server takes a long time,the browser may appear dead. Your users might have to close the tab or the browser.
How to send Synchronous request by jQuery?
$.ajax method of jquery supports a lot of options , there is an option called
async which is true by default . You can set it to false. You can find it here
Comments
Post a Comment