Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > JavaScript AutoRefresh

JavaScript AutoRefresh
Thread Tools
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Oct 20, 2004, 05:20 AM
 
How does one do one of these? I basically want to mirror HTML's own refresh ability, where it sends you to another URL after n seconds, but I need to also specify a target "_TOP", something you can't do in HTML, because the page I'm working with is in a frameset, and I need to redirect the whole set.

:-) Thanks
     
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Oct 20, 2004, 05:37 AM
 
The way you end up doing it can change, but here's the gist:
Code:
setTimeout(function() { top.location.href = "somepage.html"; }, 5000);
That can be wrapped in a function to be called onload, or just chucked into the documents <head> if you're not bothered about the page loading fully...

The 5000 denoted five seconds, btw.
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:17 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2