Difference between synchronous and asynchronous request

Asked By 30 points N/A Posted on -
qa-featured

Hi friends,

Can I use Java applet instead of AJAX? 

What's the difference between a synchronous and asynchronous request?

Thanks.

SHARE
Best Answer by Sharath Reddy
Answered By 15 points N/A #108626

Difference between synchronous and asynchronous request

qa-featured

In case you're not obvious what asynchronous indicates that, it's the versatility to deal with procedures separately from substitute procedures. Synchronous that is that the author of asynchronous, then means procedures are reliant upon substitute procedures.

Asynchronously running ways change from this scenario as a result of the running procedures are managed separately of every substitute and to significant level triumphs over the container of history on the internet web page style.

Because the past weblog reveals the example of Ajax, the finish idea of this system is to use a little JavaScript at first and then force the entire top linked to an item.

This technique uses several relationships instead of the one that many historical web content use and consequent rates of speed things up considerably.

Best Answer
Best Answer
Answered By 590495 points N/A #108627

Difference between synchronous and asynchronous request

qa-featured

By default, all requests are sent asynchronously. The “XMLHttpRequest” supports both asynchronous and synchronous requests and communications. But for performance reasons, asynchronous request should be chosen

. In synchronous request, the request made can leak events and memory and can block the execution of the codes. If this happens it can cause severe problems. The only reason when to use synchronous request is to effortlessly smooth the progress of downloads within web workers.

Below is an example of the simplest way of using asynchronous request.

The simplest way you can use asynchronous XMLHttpRequest

In line 2, the third parameter specifies that the request should be managed asynchronously. There are also a few cases where the use of synchronous request is preferable than asynchronous. See the image below for an example of synchronous request.

The simplest way of making the synchronous HTTP request

For more examples on the asynchronous and synchronous requests, you may visit here.

Answered By 30 points N/A #108628

Difference between synchronous and asynchronous request

qa-featured

Thank you very much everyone for your explanation and appreciation. Among those comments I especially appreciated to Sharath, for his understandable explanation and example.

Checking his comment, for performance reasons, will be good asynchronous request as well as difference, in a word, a program does not stay for replying after requesting an asynchronous identify whereas synchronous does so.

Also provided example helps me to understand better about the asynchronous and synchronous. He is also specified in the comment on how I will use asynchronous request in a simplest way as well as the links gave me a great deal of idea.

Thanks Sharath, be well.

Related Questions