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();
}
var divContentCache = {}
var updateDivContent = function(id, content) {
var div = document.getElementById(id);
if (div.innerHTML != content) {
div.innerHTML = content;
if (divContentCache[id] != content) {
document.getElementById(id).innerHTML = content;
divContentCache[id] = content
return true;
}
return false;