簡體   English   中英

Spotfire:如何通過Javascript重新加載/刷新文本區域html

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

我有一個HTML頁面,每5秒自動刷新一次。 此頁面包含來自3個不同服務器的3個圖像,我想並排顯示並每5秒刷新一次。

 <!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> 

我正在使用http-equiv來刷新html,它在Collaboration視圖中是一個HTML頁面時工作正常。 但是現在我需要將這個相同的html移動到文本區域可視化中,並且刷新在那里不起作用。(主要是coz協作不接受靜態HTML,我將不得不讓服務器在某處運行以保持html活着。可行但是不是一個好的解決方案。)

我知道一些替代方案,比如使用iron-python來重新加載文本區域的html內容(感覺像是一個過度殺戮+讓它在循環中睡眠會凍結它 - 這將是一個不必要的挑戰)或者只是將圖像用作標簽(它有它自己的挑戰,並且是我已經提出的另一個問題的主題。)但我想知道是否有一種方法可以使用JavaScript(顯然我對JS不好,所以無法破解它。)重新加載文字區域內容?

感謝您的解決方案和想法。

嘗試頁面刷新使用元標記和內容與時間,您可以在下面的URL檢查

使用元標記在HTML中自動刷新代碼

你試過這個嗎?

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

這里開始

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM