mirror of
https://github.com/TangentFoxy/lovebird.git
synced 2025-07-28 11:02:19 +00:00
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:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user