Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!
How to make updateDom actually refresh <img src...>?
Hello - hoping someone can help:
I’ve created a module that displays some data graphed with Plotly. Plotly provides a link to a .png of the graph. I then include that link within the wrapper.innerHTML (e.g. "img src = “https://plot.ly/~myPlotlyAccount/myGraph.png”). That all works fine and the graph shows up great within the module. However, when the graph is updated with new data, and I call updateDom to reflect the newly updated graph, the image does not change (though the .png file at the plotly link has changed). I assume the mirror is pulling some kind of cached ‘myGraph.png’, but I can’t figure out how to prevent that. If I completely refresh the browser (or stop and restart the mirror) it will load the latest, updated myGraph.png.
I’ve tried adding a timestamp to the img src address, but that doesn’t seem to help. Any other suggestions for how to make the dom actually refresh this particular image???
Thanks for any help you can offer!!
OBS: I had to add spaces after the " < " before the end " > ".
Just remove them when you use it.
Otherwise it would not show.
Hi @Snille ! Thanks very much for the help. Unfortunately, that solution isn’t working for some reason. I’d originally tried:
var imagesource = ‘< img src=‘https://plot.ly/~myPlotlyAccount/myGraph.png#’ + newDate().getTime() + ’ />’;
wrapper.innerHTML = imagesource;
Any other possible solutions?? Thanks again for the help!
I figured it out. Of course, I had included an errant ’ " ’ in the img string. Thanks again for focusing me in the right direction!
Oh, sorry, I completely forgot about this topic. Good that you solved it.