Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Jackie Jen
Jackie Jen
2,723 Points

Doing seach function on auto scroll load feature like facebook

I have done the auto scroll load feature like facebook. I fixed it, everytime when i scroll to the bottom it will auto load another 4 data row from my database and display on in HTML. By the way i also want to do a search feature.

For search feature, i'm using jcfilter (https://github.com/jaschahal/jcTextHighlighterFilter/tree/master/jcFilter/jquery) which is search the same wordings. Now the problems come, if i did not scroll to bottom it won't load extra 4 rows of data. that mean my search feature only search for the 1st 4 data that display. Is there any idea on the search feature? Let said total have 12 data, but at the very 1st it only display 4 data. when i search for similiar words, the search features will go through all the 12 data and filter out the data that have similiar word.

if not the search feature i currently done is useless.

1 Answer

Dylan Shine
Dylan Shine
17,565 Points

Hi Jackie,

What sort of backend are you working with?

In the event you are working with a backend and you need to dynamically create content on your page from your backend (i.e. facebook notifications) then I would suggest you use a mix of AJAX and jQuery UI to make that possible. If the content is already existing, and you want to hide it until your user scrolls to a certain point of the page, I would suggest you just look into the jQuery UI library for the given effect you want.

Hope that helps, Dylan