简体   繁体   中英

Spotfire: How to reload/refresh a text area html through Javascript

I have an HTML page which auto refreshes itself every 5 sec. This page contains 3 image from 3 different server which i want to show side by side and and refresh every 5 second.

 <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>HMI Remote Monitoring</title> <meta http-equiv="refresh" content="5" > </head> <body> <table> <tr> <td>Chamber 1:100.206.214.19</td> <td>Chamber 2:100.206.214.122</td> <td>Chamber 3:100.206.214.145</td> </tr> <tr> <td> <img border="2" src="http://100.206.214.19/remote/display.bmp" alt="" name="displayImage" width="400" height="240"> </td> <td> <img border="2" src="http://100.206.214.122/remote/display.bmp" alt="" name="displayImage" width="400" height="240"> </td> <td> <img border="2" src="http://100.206.214.145/remote/display.bmp" alt="" name="displayImage" width="400" height="240"> </td> </tr> </table> </body> <html> 

I am using the http-equiv to refresh the html and it works fine when it's an HTML page in Collaboration view. but now I need to move this same html into a Text area visualization and the refresh doesn't work there.(Mainly coz collaboration dont accept static HTML and i'll have to keep a server running somewhere to keep the html alive.Doable but not a nice solution.)

I know a few alternatives such as using iron-python to reload the html content of the text area(Feels like a overkill + making it sleep in a loop will freeze the viz - will be an unnecessary challenge) or just use the images as labels(it has it's own challenges and is subject of another question I have raised already.) But I was wondering if there's a way we could use JavaScript(clearly I'm bad with JS, so couldn't crack it.) to reload the text area content?

Thanks for your solutions and ideas.

try page refresh using meta tag and content with time you can check in below url

Auto refresh code in HTML using meta tags

Have you tried this?

setInterval(refreshWidth,500) //trigger every .5 sec

from here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM