Should I keep track of the number of html elements loaded on a page?

I have an application that displays a page with 5-10000 rows in a table element and has a drop-down menu that switches to other views with a similar structure. I am currently doing an asynchronous request when switching between views (I also clear / delete the current view from the document) and load the corresponding list each time; however, I was thinking about

1) loading all the views in the background until they are requested to view so that they instantly load when clicked.

and

2) Just hiding a certain set of lines, and not deleting it, so if the client moves back, it will also be instant.

This would mean that potentially 10 thousand thousand html elements would be loaded into the current document; This is problem? What if it was over 10 thousand?

+7
html design asynchronous
source share
4 answers

Uploading 10,000+ HTML elements to your page is not a smart idea. If the user computer has a normal speed to high speed, the user may experience a slight lag, and if the user's computer is slow, this can lead to a system crash (depending on the amount of RAM on the computer).

A method you could learn is lazyload HTML elements - this means that when the user scrolls to a specific part of the page, the elements are loaded via AJAX. (also known as endless scrolling).

This means that the browser rendering engine does not have to display so many elements at a time, which saves memory and increases speed.

+4
source share

It depends on the HTML elements, but I would say, as a rule, do not load upfront.

When I say that it depends on the elements, I mean, for example, take a look at facebook. They upload maybe 10 or 20 elements to the feed, and then add more as they scroll through, because each element is so rich in content (photos, videos, etc.).

However, on the other hand, think about how much information on each line, if it says less than 500 bytes, 500 x 10000 = 5 MB, which is not a terrible download for a web request, and if you can cache intelligently, maybe it will be much less.

On the bottom line, don't assume that the number of HTML elements matters, think about the amount of data that it makes up. My advice is to cross this bridge when you get there. Control the time of the request, if they are too long, come up with an AJAX page loader, which should not be too complicated.

+1
source share

The size of your html document will be significant ... I once had a page with 5,000 ~ 10,000 positions (table rows), and the browser (IE) displayed the path for too long (page loading, parsing and rendering).

The best solution for me is to create a WebService with the LazyLoading system.

So IMHO yes, you should keep track of the number of elements in the HTML document .

0
source share

Oh sure! You can track the number of elements in an HTML document.! Use FireBug in Firefox! enter image description here

0
source share

All Articles