I have a jQuery post method whicih looks like this:
$.post("/SearchCompetitor/Index", { username: _username }, StartLoading())
.done(function (data) {
if (data !== "UsernameError") {
StopLoading();
var brands = $('<table />').append(data).find('#tableProducts').html();
$('#tableProducts').html(brands);
$("#tableProducts").simplePagination({
// the number of rows to show per page
perPage: 10,
// CSS classes to custom the pagination
containerClass: '',
previousButtonClass: '',
nextButtonClass: '',
// text for next and prev buttons
previousButtonText: 'Previous',
nextButtonText: 'Next',
// initial page
currentPage: 1
});
var header = $('<div />').append(data).find('.bs-glyphicons').html();
$('.bs-glyphicons').html(header);
$('#tableProducts thead, #header').fadeIn("slow");
$('#emptyText').hide();
}
else {
StopLoading();
ShowMessage("No eBay user was found under: " + $('.txtSearch').val());
}
})
.fail(function (data) {
StopLoading();
ShowMessage("Something went wrong, please try again!");
});
When the post data object doesn't contains a lot of items inside then its fairly okay and it loads without problems...
But when I'm updating the table with 2000+ items inside, it presents a huge issue, I was testing it on firefox browser and it literally crashes every time I work with 2000 + returned items...
My question is, is there any way to avoid browser freezing, maybe some "client side async method" like C# has when using async method to prevent user UI from freezing when working with big chunks of data??