How does Facebook Ajax work? 2-3 months ago they were using # but now the whole addressbar is changing.
What is AJAX? AJAX = Asynchronous JavaScript and XML. In short; AJAX is about loading data in the background and display it on the webpage, without reloading the whole page. Examples of applications using AJAX: Gmail, Google Maps, Youtube, and Facebook tabs.
Yes Facebook is fully AJAX based, unless you disable JS in your browser. Yes. You are absolutely correct. Facebook uses ajax calls to make HTTP requests without refreshing the entire page when an action occurs. Obviously, when you upload or post a status without a refresh, that’s AJAX working.
jQuery provides several methods for AJAX functionality. With the jQuery AJAX methods, you can request text, HTML, XML, or JSON from a remote server using both HTTP Get and HTTP Post - And you can load the external data directly into the selected HTML elements of your web page!
For sites like Facebook, Quora, Twitter, that are generally social and update near-constantly, loading more data periodically through Ajax can improve the experience. Even those three sites, however, don't load new data in the same way: Quora updates stats while on a question page, and brings you notifications about activity on other pages.
The first approach used is called "Ajax Crawling" (also refer to this answer).
But I think the new approach you are talking about is just the HTML5 History API. Github is using this approach for their tree browsing, and you can learn more about it here. (I recommend ALL readers to read and watch the video as it's very informative)
EDIT:
Just to point out that Facebook is definitely using the HTML5 History API (direct link from the previous github article).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With