AutoSuggest on Facebook - how does it work?

Discussion in 'PHP' started by Strike X, Jun 27, 2008.

  1. #1
    You should be familiar with facebook by now :)

    On a profile, you can type your friend name but short letters, textbox will suggest the following match like this below:

    [​IMG]

    Can you tell me how does this work? does it connect to the database as you type in the textbox? that is very sensitive to the database server. Imagine thousands of users typing friend name or even trying to abuse on the textbox.

    I am guessing each profile has an xml file with list of friends?
     
    Strike X, Jun 27, 2008 IP
    zangief likes this.
  2. zyklon

    zyklon Active Member

    Messages:
    274
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    it already has the data in some data structure, and is just sorting through it, its all javascript.
     
    zyklon, Jun 27, 2008 IP