function OnItemsDownloadSuccess(response) {
var xmlDocument = $.parseXML(response.d);
var xml = $(xmlDocument);
var items = xml.find("Table1");
var i = 0;
//alert(response.d);
if (items.length > 0) {
$("#searchingResultsFound").eq(0).html(items.length + " results found. Please wait while we render your items.");
while (i < items.length) {
var item = $(items[i]);
Of which items can be anywhere from 0 to 3000+ elements.
Then, within that loop, it either removes the row, or it adds data to about 20 elements.
And make a copy of whatever you need to change and shove it inside a DocumentFragment. Manipulate that and then you change the HTML of your table or whatever
@EBrown By doing that, you let the function finish and return, without grinding. Also, it gives time to render whatever the browser has to
It is something that can and should be done assyncronously (misspelled?)
The purpose of this code is to allow to add functions to a queue, that will execute them sequentially.
With this in mind, it also allows to execute them with a defined delay, to prevent them from blocking the browser.
(function(window, undefined){
'use strict';
var queue = [];
var r...