mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-15 22:54:21 +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:
parent
b4e007b035
commit
3b2e834711
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user