I am doing a jQuery $.get to a html file, and in the success function I filter on a select block and take the options apart, rendering the text of the selects as paragraphs in divs that I append in my markup.
Getting and rendering the selects takes a while (there are about 8000) but I was expecting the div’s to show up one by one and letting me work on them (I assign click and hover events to them with .delegate …), but they show all up at once and my browser window is blocked.
I even explicitly set async: true with an $.ajaxSetup before the $.get (which should not be necessary as it’s the default).
I must be missing something fundamental but have no idea what …
Thanks in advance for ideas and tips.
I am doing a jQuery $.get to a html file, and in the success
Share
You should load the results in smaller chunks. In pseudocode it will be something like this:
Otherwise most browsers, especially on slower computers, will freeze for a few seconds while they try to update the DOM.
UPDATE: Actual jQuery code
Your server side script should do something like this: