MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Dynamically update html



  • Hi,

    I have created a departure board for public transportation, including real time updates to departure time within the module. The board is updated every 20s, by passing notifications from node_helper that updates the DOM thru getDom function. Challange is that i have a marquee element within my HTML that i dont would like to be reset every 20s, instead i would like that HTML element to be kind of static within the module.

    Is there any possibility of not refreshing the complete HTML, like using “updateDom” instead of “getDom” so that my marquee element is not reset?

    BR



  • I resolved it by implementing a updateBoard function that checks if tables has been rendered and if just updates the innerHTML of that div. Was great to read ANOTHER WAY TO CONTROL OUTPUT in the beginners KB, https://forum.magicmirror.builders/topic/8534/head-first-developing-mm-module-for-extreme-beginners