Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8963817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:26:33+00:00 2026-06-15T16:26:33+00:00

This is my first question on this website, and I’m hoping someone with experience

  • 0

This is my first question on this website, and I’m hoping someone with experience can give me some advice.

I have built a javascript/jquery app for a client, and the key feature of it is the filtering mechanism for certain items. There is around 2000 of those items which are stored in a list like this:

<ul>
<li id='3000429'>Item</li>
<li id='3000429'>Item</li>
<li id='3000429'>Item</li>
<li id='3000429'>Item</li>
</ul>

So around 2000 lines of html just for that, I’ve removed the onClick handlers for the <li> elements for demonstration purposes. The html list with appropriate ids for the items is generated from the mysql db via php on page load.

What I do now is filter my results from my database and hide all the items first, then once I get the calculated results back from PHP via ajax, which is an array od ids, I then display only the items whos id is in the results array (using jQuery’s .show() and .hide() ). So all the items are present in code all the time, just that some are hidden.

Would it be better to use JSON and totally remove all the items from the html list upon the receive of results from it, and then generate new html items that are filtered out from the db via JSON objects and jQuery.

I am asking because I know that some browsers don’t take the stress of a lot of html very well (IE especially…).

When I get a lot of results back, say more than 1000, all browsers tend to lag a bit, probably because they are going through all the items and re-displaying the items (.show()). If the user triggers the filtering in short intervals the user experience sucks.

So, from a performance point of view, do you guys think I would be better off with loading JSON and constantly generating and deleting html, or the way I have it set up now (the show/hide method)? I’m new to JSON so I’m not quite familiar with the performance aspects of it when it comes to a lot of data.

Thanks in advance, I appreciate it!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:26:34+00:00Added an answer on June 15, 2026 at 4:26 pm

    You should use additional library, like backbone & underscore stack (underscore has fenomenal filtering & other utilities, and templating, and the stack is perfect for your purpose), or you should consider angular.js, which also has much higher level of operation on lists, objects, data & html.
    In angular you can achieve complex filtering & dynamic html updating probably with 2-3 lines of code.

    In any case, regardless of performance, don’t do it with html <li> items, do it with data.
    These libraries I suggested will make it much simpler & faster.

    Worth learning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first question on this wonderful website. Lets say I have a
Hey this is my first question on this website. Im creating a webpage for
this is my first question I have searched for any launching activity questions and
this is my first question on stack overflow. Some quick background, this is not
This is my first question. I have a page for image upload on my
this is my first ever question on this website but it has helped me
I'm new in this site and this is my first question. I have to
It is my first question. I personally find this website awesome and helped me
I am new to this website; in fact this is my first question. So
This is my first time asking a question in this website so please bear

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.