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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto refresh framed pages?

Status
Not open for further replies.

RobinI

Technical User
Jun 4, 2001
4
US
I have a site with frames. The top frame contains links to pages in the bottom frame. My problem is that users are complaining that the pages aren't appearing as updated. They have to know enough to right-click on the bottom section and refresh that page.

I don't want to use "refresh", "expires" or "no-cache" as I've been told that search engines treat these tags as flags not to index that page.

Is there any way to include a java-script command that when the user clicks on a link to a page, it will tell it to refresh the page upon loading?

Or any other solutions to this problem?
 
RobinI,
What you might try is "onload=refresh" under the body tag of the frame that you are trying to refresh. If this doens't help I can forward you a little JavaScript that I created a while back.

Nunzio

You make it I crash it.
 
RobinI,

Try this if that doesn't work

Java Script Refresh Instructions
--------------------------------------------------------------------------------
Java Script Refresh can be done with either Java Script or a META tag.
The META tag contains three parts: what to do (refresh), when (in sec), and where (URL).
The single line goes into the <HEAD> part of your <HTML> file.
The Java Script contains two parts: where (location.href) and when (in msec).
The Java Script goes inside the <BODY> tag of your <HTML> file.


The Script
<!-- Copy this code into the HEAD part of your HTML file -->

<META HTTP-EQUIV=&quot;Refresh&quot; CONTENT=&quot;5;URL=http://www.url.com&quot;>

<!-- or it can be done with a onLoad event handler. -->

<!-- Copy this code inside the BODY part of your HTML file -->

<BODY onLoad=window.setTimeout(&quot;location.href=' You make it I crash it.
 
What you might try is &quot;onload=refresh&quot; under the body tag of the frame that you are trying to refresh.

I've been trying this and it works - except that I keep getting a script error. I've tried it several different ways, still no luck. Can you tell me what I'm doing wrong?

<body onLoad=&quot;refresh()&quot; &quot;bgcolor=&quot;#000000&quot;>
<body onLoad=&quot;refresh(1)&quot; &quot;bgcolor=&quot;#000000&quot;>

Thanks for the help.
 
RobinI,
On the refreash button where you have 1 are you putting the frame or the file that you want to refresh.also if you have it on the web I might be able to look at the coding and see what the script error is telling you. if so just post your URL if you want to.

Nunzio You make it I crash it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top