borayeris
borayeris

Reputation: 2650

Facebook and Ajax

How does Facebook Ajax work? 2-3 months ago they were using # but now the whole addressbar is changing.

Upvotes: 6

Views: 7142

Answers (2)

ifaour
ifaour

Reputation: 38115

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).

Upvotes: 10

Emil Vikström
Emil Vikström

Reputation: 91902

They still use # as far as I can tell (but maybe we are on different versions?). For me, their links are for different pages, but they intercept my onclick and change the click to an Ajax request instead. Maybe this is to make cleaner URLs when copying and/or make it work without JS?

Upvotes: 0

Related Questions