do NOT do XML requests IN the getDom function… do them outside (timer) and call updateDom to signal changes to be presented. getDom() should ONLY set info for presentation… nothing else.
preparation should be done somewhere else… (timer, event handler, …)
don’t replace the entire wrapper div each time, like ripping the heart out
var wrapper = document.createElement("div");
don’t look up (getElementbyId) over and over… get it, use it multiple times
6 lookups here, need only 2… note that you are searching the ENTIRE web page (document.), not YOUR modules content (wrapper .div), and from the very top… so as the page gets fuller and fuller, the search has more things to look thru…
case 1783:
document.getElementById("wohnzimmer_beamermodus_bezeichner").innerHTML = "Beamermodus:";
document.getElementById("wohnzimmer_beamermodus_bezeichner").style.float = "left";
document.getElementById("wohnzimmer_beamermodus_bezeichner").style.width = "94%";
document.getElementById("wohnzimmer_beamermodus").innerHTML = status;
document.getElementById("wohnzimmer_beamermodus").style.float = "left";
document.getElementById("wohnzimmer_beamermodus").style.width = "6%";
don’t update stuff that didn’t change
here u create these elements without consideration if they already exist…
var schlafzimmer_heizungsgruppe_bezeichner = document.createElement("div");
don’t create lots of new content… (createElement) if you don’t need to.
here u create these elements without consideration if they already exist…