From 3b2e834711931e6857ca89d2ba045dba69c59d89 Mon Sep 17 00:00:00 2001 From: rxi Date: Sun, 13 Apr 2014 17:03:44 +0100 Subject: [PATCH] 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. --- lovebird.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lovebird.lua b/lovebird.lua index ae58358..8e09e13 100644 --- a/lovebird.lua +++ b/lovebird.lua @@ -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;