what would happen if Facebook reloads the news feed every time you scroll through the end of news feed?Not exactly agonizing right, consider how frequently you more likely than not reloaded when you like up to 5 posts.
Introduction of AJAX
This was the condition of the web before the year 2000 when Microsoft presented the Ajax innovation (XMLHttpRequest question) to Internet Explorer which encouraged correspondence to servers without reloading the page. Not long after other enormous organizations like Google and Facebook began fusing it.
StepsTo write a basic Ajax request, we need to…
- Make an instance of the XMLHttpRequest object.
- Open the request.
- Send the request.
- Handle the request.
var request = new XMLHttpRequest();
request.onreadystate = handleResponse;
request.open('GET', 'url', true);