0

I have question about advice of performance. I have site with tabs, it looks like in included image.

http://s8.postimg.org/6sild5nmt/Untitled.png

User starts with open TAB0, my question concernsTAB1 content, where I have almost 350 divs (the count of div is constant ). Load they with page load ? Or load empty main div and on event.click load it with AJAX, and create node tree in javascript ? I need to mention that all that div has it own event listeners (hover,click), which I add after user click tab 1, because if less listener the better. I can predict that it depends of how often users visited tab1.

To sum up the main question: How big impact on the browser performance will have load there almost 900 (I have 3x300) ?

Sonny D
  • 897
  • 9
  • 29

1 Answers1

0

Use setTimeout() to make ajax request in particular intervals and populate the data to div's continuously after page loads.

Refer: How to fire AJAX request Periodically?

Community
  • 1
  • 1
webcoder
  • 656
  • 6
  • 12
  • At that point why wouldn't you just load the content on the initial request server side? – Snuffleupagus Oct 16 '13 at 14:18
  • Since it will take some time to load all data at once. – webcoder Oct 16 '13 at 14:19
  • You suggest don’t load all on page load, just load part. If so the better is load div only when user need it (click on each tab), becouse we even don’t know if user what see the tab content. Page load time isn't a problem, I afraid that big count of div will be lags browser – Sonny D Oct 17 '13 at 07:34