I'm running a webpage dashboard on a TV on the production floor of our factory so workers can see their live uptime, scrap etc.

I need the page to refresh when new data is available.

I want to load a page in a hidden iframe every x seconds, if the iframe is blank then do nothing but if there is a URL in the iframe then load that URL in the main page.

Example:
The Main page dashboard_Machine3.html calls a page in a hidden iframe newdata_Machine3.html every 10 seconds. If it sees that the newdata_Machine3.html page is blank, then nothing is done. If newdata_Machine3.html contains text eg "dashboard_Machine3.html" or "fire_alarm.html" then load that page in the main window.

This way I can jump to another screen if there is a critical problem somewhere or refresh that same page if there is new data to display.

-- Sorry if I wasn't clear, its a tricky one to explain :confused:

Is this possible?

hmm, no takers...

How about this then:

Page A is displayed on a TV showing some charts and info.
Page B is not displayed anywhere but contains the text "0"
As soon as page B contains the text "1", then refresh page A

Is there any way to so this?

By watching page B using a hidden iframe, then triggering a refresh event depending on its contents was my thought. But I'm no web developer.

Thanks anyway

iframe code for no problem

<html></html>

iframe code for problem condition

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><script type='text/javascript'>
<!-- 
top.location = 'location of selected problem page'
//--></script></head><body></bopdy></html>

That works great! Now I can remote control my web browser without constant refreshes.

Thanks almostbob


Here is the code I used on the main page1. Main page2 looked the same but with different content.

<html> 
<head> 
<script type="text/javascript">
    function refreshiframe() 
    { 
        parent.frame1.location.href="/sub.html" 
        setTimeout("refreshiframe()",1000); 
    } 
</script>
</head>


<body bgcolor="#ffffff" onLoad='refreshiframe()'> 
Main Page1 content

<IFRAME id="frame1" src="/sub.html" style="width:0px; height:0px; border:0px">
</body> 
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.