Changed JS updateDivContent() to check against its own cache

updateDivContent() now checks against its own cache to assure the
content has actually changed before updating the innerHTML of the div.
This commit is contained in:
rxi
2014-04-13 17:03:44 +01:00
parent b4e007b035
commit 3b2e834711

View File

@@ -194,10 +194,11 @@ end
req.send(); req.send();
} }
var divContentCache = {}
var updateDivContent = function(id, content) { var updateDivContent = function(id, content) {
var div = document.getElementById(id); if (divContentCache[id] != content) {
if (div.innerHTML != content) { document.getElementById(id).innerHTML = content;
div.innerHTML = content; divContentCache[id] = content
return true; return true;
} }
return false; return false;