How does Facebook work with AJAX? Thanks a lot!
Before
http://www.facebook.com/#/events.php
Now
http://www.facebook.com/?sk=events
It's still doing the hash URLs and AJAX requests under the covers (though it fails fairly gracefully as well), it's just using some HTML5 features with history to push a different URL to your address bar.
If you view the site in an older browser that doesn't support this yet (everything besides Chrome at the moment) you'll still see the #!/path
format (for Google indexing) on the URL, for example:
http://www.facebook.com/home.php?#!/?sk=events
Specifically it's using history.pushState()
and history.replaceState()
added in HTML5, if the browser supports it to display another (direct) URL in your address bar.
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