I noticed that like Google Email, FB's source code shows nothing but Javascript. Why do they use JS to write the page?
+3
A:
Because their pages are extremely dynamic; most of the content has to be constructed dynamically.
Marcelo Cantos
2010-10-23 01:22:44
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
2010-10-23 01:23:58
@Evan Mulawski I rather doubt that. They're loading in HTML via JavaScript, the browser still has to fetch and render it.
ceejayoz
2010-10-23 01:25:04
@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
2010-10-23 01:29:32
A:
All their content is populated using AJAX giving it a dynamic and desktop-ish look and feel (aka the instant messaging features)
Sydenam
2010-10-23 01:28:33
+2
A:
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.
Eldar Djafarov
2010-10-23 05:09:18