4

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.

S4nd33p
  • 431
  • 2
  • 7
  • 17
  • hope ajax will be useful – brk Dec 06 '16 at 05:06
  • Thanks for the pointer, but, will ajax run without hosting in a server? does ajax run in spotfire? If i have to use a separate server then this basic html itself gets the job done, so what additional benefit i'll gain from running ajax? – S4nd33p Dec 06 '16 at 05:52

2 Answers2

2

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

Auto refresh code in HTML using meta tags

Community
  • 1
  • 1
chaitu
  • 21
  • 1
  • Thanks for the reply Chaitu, 2 things, 1: I'm already using meta tag refresh(Look at the line 6 of my html code) 2: It doesn't work in the Html Text Area of spot-fire and that's what is the issue i'm trying to solve. – S4nd33p Dec 06 '16 at 07:00
2

Have you tried this?

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

from here