문제

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

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top