Read the statement by Michael Teeuw here.
updateDom() blocks MagicMirror
-
@1blaunitrox the black screen is cause your module source crashed the browser… oops…
its this.updateDom()
look at my sample module
https://github.com/sdetweil/SampleModule -
@sdetweil I changed getDom() to this:
getDom: function() { const wrapper = document.createElement("div"); if(response.lenght <= 0) { wrapper.innerHTML = "No Entries"; } else { wrapper.innerHTML = this.response; } return wrapper; },
There is a check if the array has any entries.
But the mirror shows “undefined”
-
@1blaunitrox said in updateDom() blocks MagicMirror:
if(response.lenght <= 0) {
this.response.length
always gotta use this.
unless u created the variable INSIDE the routine using it…
use the debugger
-
Not exectly what I wanted :joy:
Why can getDom() not transfrom the array in a readable string? -
@1blaunitrox yes, this.response is an object
this.response = { "name": "Test", "entries": { "lessions": "Teacher Subject Room representation" } };
html doesn’t know objects
-
@sdetweil Is there a Json parser I can use?
-
@1blaunitrox said in updateDom() blocks MagicMirror:
Why can getDom() not transfrom the array in a readable string?
getDom() CAN do anythign YOU implement… it does NOTHING by itself…
-
@sdetweil JSON.parse, JSON. stringify
u have an object so, stringify turns it into text
parse takes text and makes an object -
@sdetweil What about
JSON.stringify(this.response);
-
@1blaunitrox that would work
but it will be the JSON text representation of the object
all fields and values