How does Facebook load pages?

Discussion in 'HTML & Website Design' started by PhantomBurn, Oct 26, 2008.

  1. #1
    Hey,

    So I just find this interesting, and was wondering if anyone knew how to do this.

    If anyone has gone to facebook.com and logged in, you will notice there is a little bar at the bottom of your screen.

    Whenever you navigate through Facebook, the main page reloads, url changes, all of that (So no iframe). But that bottom bar never changes. It is always there and never gets reloaded (You can test this by highlighting the bar and then navigating through pages)

    How do they do this? All I know is it has to do with javascript.

    EDIT: Sorry, wrong section (I posted in the wrong window I had opened)
     
    PhantomBurn, Oct 26, 2008 IP
  2. Dimmo

    Dimmo Well-Known Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    126
    #2
    Im pretty certain it uses AJAX (asynchronous JavaScript and XML) to load the pages in the background so it doesn't have to load pages to get the content
     
    Dimmo, Oct 26, 2008 IP
  3. mkda

    mkda Active Member

    Messages:
    139
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    mkda, Oct 26, 2008 IP
  4. PhantomBurn

    PhantomBurn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    But what about it re-writing the url?

    And when you click on a link, the page actually loads (It shows the little loading wheel in firefox on the tab)
     
    PhantomBurn, Oct 26, 2008 IP
  5. mji2010

    mji2010 Active Member

    Messages:
    762
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #5
    mji2010, Oct 26, 2008 IP
  6. PhantomBurn

    PhantomBurn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not that sorta loading wheel. I mean when you load a page in firefox, its tab (if you have more than one site opened) will show a loading wheel in the tab itself.
     
    PhantomBurn, Oct 27, 2008 IP
  7. Dimmo

    Dimmo Well-Known Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    126
    #7
    I would say that the header and footer aren't reloaded every time a link is clicked, so I don't think there is any url rewrite going on it a new page being loaded with exception of the header and footer content.

    I found this article which may be what is happening:

    http://ajaxian.com/archives/ajaxified-body-when-to-refresh-the-page
     
    Dimmo, Oct 27, 2008 IP