How does Facebook work with AJAX?

How does Facebook work with AJAX? Thank you very much!

Before

http://www.facebook.com/#/events.php 

Now

 http://www.facebook.com/?sk=events 
+4
source share
1 answer

It still handles hash urls and AJAX requests under covers (albeit not so gracefully elegantly), it just uses some HTML5 history features to specify a different url in the address bar.

If you are viewing the site in an earlier browser that does not yet support it (everyone except Chrome at the moment), you will still see the format #!/path ( for Google indexing ), for example:

 http://www.facebook.com/home.php?#!/?sk=events 

In particular, it uses history.pushState() and history.replaceState() added in HTML5 if the browser supports it to display a different (direct) URL in the address bar.

+9
source

All Articles