0

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

4 Answers 4

4

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.

3

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

3
  • I agree. And now that all of the new browsers are bragging of "2x faster javascript," it probably loads faster than static HTML. Commented Oct 23, 2010 at 1:23
  • 1
    @Evan Mulawski I rather doubt that. They're loading in HTML via JavaScript, the browser still has to fetch and render it.
    – ceejayoz
    Commented Oct 23, 2010 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. Commented Oct 23, 2010 at 1:29
0

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

0

Because AJAX (Asynchronized JavaScript and XML), provides dynamic feature to webpages, or websites, with this multiple parts of single page can work or can load simultaneously, so it provide great flexibilty and speed to loaading and working of pages

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.