Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Single Frame Auto Refresh

Status
Not open for further replies.

mcelligott

Programmer
Apr 17, 2002
135
US
Hello all,

I am attempting to do something I have never done before and was wondering if any of you wonderful people had some suggestions. Here is what I am trying to do; the employees are looking at their work schedule for that shift in a web browser which auto refreshes every 60 seconds (yes, we make changes to the schedules frequently), but it goes back to the first page every refresh. I would like to set it up so they can choose which page they want to continuously view but still get refreshed without jumping back to the first page.

Here is the code I have so far:
Schedules.htm
Code:
<HTML>

<meta HTTP-EQUIV="Refresh" CONTENT="15;url="C:\Test\schedules.htm" TARGET="showframe">

<HEAD>

<TITLE>ECD Shift Schedule</TITLE>

</HEAD>

<frameset cols="100,*">
	<frame Name="Menu" src="C:\Test\menu.htm" scrolling="no">
	<frame Name="Showframe">
</frameset>

</HTML>

Menu.htm
Code:
<a href ="C:\Test\Current Schedule\TCC-Fire.mht" target ="showframe">TCC-Fire</a><br>
<a href ="C:\Test\Current Schedule\Police.mht" target ="showframe">Police</a><br>

The two files above are generated by Microsoft Excel as single file web pages automatically when the Supervisor clicks the save button.

Everything works pretty well except for the fact that the "showframe" frame keeps going back to "TCC-Fire.mht". A bit annoying if you need to continuously monitor the "Police.mht" schedule for updates.

Any suggestions?
 
Hi

mcelligott said:
Any suggestions?
Yes. Either
[ul]
[li]Move the [tt]meta[/tt] [tt]refresh[/tt] tag from the frameset document into the content document.[/li]
[li]Remove the [tt]meta[/tt] [tt]refresh[/tt] tag and refresh the content document using JavaScript.[/li]
[/ul]
If you choose the first way, you have to process the saved HTML file to insert the [tt]meta[/tt] tag.

If you choose the second way, read about the Same origin policy.


Feherke.
 
Hello Feherke,

Thank you for responding.

I tried your first suggestion by moving the meta refresh from the Schedules.htm to the Menu.htm file. The result was that the Police.mht was displayed in a new browser window. However, the refresh kept going to the Schedules.htm browser window, not the Police.mht browser windows. I was also unsure what you meant by:

you have to process the saved HTML file to insert the meta tag

I did not try your second suggestion because I am not versed in JavaScript.

Would you be able to explain what I need to do further (or by example)?

Thanks,

Bob
 
Hi

Currently the [red]frameset[/red] is refreshing because the [tt]meta[/tt] tag is in the [red]frameset[/red] document :

[tt][red]+-frameset-------------+[/red]
[red]|[/red] +------+ +---------+ [red]|[/red]
[red]|[/red] | menu | | content | [red]|[/red]
[red]|[/red] +------+ +---------+ [red]|[/red]
[red]+----------------------+[/red][/tt]

If you want the [red]content[/red] to refresh then put the [tt]meta[/tt] tag is in the [red]content[/red] document :

[tt]+-frameset-------------+
| +------+ [red]+---------+[/red] |
| | menu | [red]| content |[/red] |
| +------+ [red]+---------+[/red] |
+----------------------+[/tt]
Bob said:
I was also unsure what you meant by:
you have to process the saved HTML file to insert the meta tag
I am quite sure you can not convince Excel to put the [tt]meta[/tt] tag into the HTML file when saving it. So you have to add it later.

Regarding the JavaScript way :
Code:
[b]<html>[/b]

[b]<head>[/b]
[b]<title>[/b]ECD Shift Schedule[b]</title>[/b]
[b]<script[/b] [maroon]type[/maroon][teal]=[/teal][green][i]"text/javascript"[/i][/green][b]>[/b]
window.onload=function() {
  window.setInterval(function() {
    window.frames.Showframe.location.reload()
  },1000*15)
}
[b]</script>[/b]
[b]</head>[/b]

[b]<frameset[/b] [maroon]cols[/maroon][teal]=[/teal][green][i]"100,*"[/i][/green][b]>[/b]
[b]<frame[/b] [maroon]name[/maroon][teal]=[/teal][green][i]"Menu"[/i][/green] [maroon]src[/maroon][teal]=[/teal][green][i]"file:///C|/Test/menu.htm"[/i][/green] [maroon]scrolling[/maroon][teal]=[/teal][green][i]"no"[/i][/green][b]>[/b]
[b]<frame[/b] [maroon]name[/maroon][teal]=[/teal][green][i]"Showframe"[/i][/green][b]>[/b]
[b]</frameset>[/b]

[b]</html>[/b]
Note that I modified the [tt]src[/tt] according to File URI scheme.


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top