Search code examples
jqueryajaxfacebooksearchajax-push

Simulating facebook search using jquery


I'm Swadesh, a young software engineer who is always fascinated about facebook applications.

Once I came across facebook search bar which searches for friends, communities, applications, etc.

I just love it, because its so fast and gives you intelligent and instant result.

I tried a similar one using JQuery. The project with a demo can be found here

Now the issue I’m facing is: I get duplicate records inserted into DOM(from where I search for the string).

The javascript search idea is as follows

  • On page load, “Load all data of friends from database into DOM”
  • Declare an array which will hold the DOM data
  • Push the DOM data into the javascript array
  • Handle the keyup event which will subsequently search for the javascipt array object. If not found it will call the ajax function which will collect data from database.
  • Push the retrieved data again into the DOM and search from there

Solution

  • Solved. During this last 6 months duration i went through different kind of solutions and finally found out the result. An exact search feature with demo and download link i posted here. http://itswadesh.wordpress.com/2011/12/23/lets-see-how-facebook-search-is-so-fast/