Take the 2-minute tour ×

I noticed that like Google Email, FB's source code shows nothing but Javascript. Why do they use JS to write the page?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

this allows them to render pages extremely fast. They just load some javascript to render everything on the screen and then load the rest.
They name it BigPipe. You can read more here http://www.facebook.com/note.php?note_id=389414033919
pretty interesting reading.

share|improve this answer

Because their pages are extremely dynamic; most of the content has to be constructed dynamically.

share|improve this answer
I agree. And now that all of the new browsers are bragging of "2x faster javascript," it probably loads faster than static HTML. –  Evan Mulawski Oct 23 '10 at 1:23
@Evan Mulawski I rather doubt that. They're loading in HTML via JavaScript, the browser still has to fetch and render it. –  ceejayoz Oct 23 '10 at 1:25
@Evan: That's not a silly suggestion at all, but in practice, you still have to fetch enough data to meaningfully populate the DOM, which, combined with the cost of dynamic generation and rendering, probably keeps plain HTML in pole position — at least for now. –  Marcelo Cantos Oct 23 '10 at 1:29

All their content is populated using AJAX giving it a dynamic and desktop-ish look and feel (aka the instant messaging features)

share|improve this answer

Your Answer


