I have around a large html data, around 200k data with sub details images and all.
The problem i am facing when i try to set the html content that i get, i am getting browser stuck issue. So what i am trying to do is i am writing an observer which checks for that particular div, whether all the html has been added. Then i need to disable the loader so the user can use
What i have tried so far
var isHtmlAppending = true
function mutate(mutations) {
mutations.forEach(function(mutation, index) {
if(index === mutations.length - 1){
isHtmlAppending = false
}
});
}
var target = document.getElementById('container')
var observer = new MutationObserver( mutate );
var config = { characterData: true, attributes: false, childList: false,
subtree: true };
observer.observe(target, config);
$.ajax({
// call the api and get the html data
success: (function(data){
$("#container").html = data.renderedHtml
})
})
How to make this working ?, any help appreciated