javascript delayed redirect

They have: 33 posts

Joined: Aug 1999

hi there i have tried to find it everywhere and all i can find is redirections based on the day of the week etc, what can i use so that a user is redirected to a designated page after a few seconds?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

As I mentioned recently in a thread on this same topic (did you search the forums?!), the 3 is how long in seconds you want the browser to wait before redirecting to a new page. Make sure that number is long enough for the page to load if necessary.

URL=http://www.yourdomain.com -- URL *must* be in all caps, and the new page MUST be a full url.

That's all.

Smiling Suzanne

They have: 33 posts

Joined: Aug 1999

thank you sooo much, i forgot to search the forums, thank you.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

that search feature gets so forgotten!

Ah, well. A good little prompt to others -- try searching! try searching! lots of good information! try searching!

Laughing out loud Suzanne

They have: 10 posts

Joined: Sep 2001

Is it possible to tell it to refresh a page into ANOTHER frame? something like

Thanks

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Instead of a meta tag, you would have JavaScript to force pages into a specific frame (like if someone tries to open a page outside of your frameset) and while I'm not sure on the exact bits and bobs in doing it, you can have it so that a specific page is loaded into a specific frame when the page loads.

Hopefully someone can explain that in more detail for you, or try a resource like javascriptcity.com or irt.org.

Smiling Suzanne

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi zeed2k,

the following will refresh the page:

parent.targetName.location.reload()

where targetName is the name of the frame you want to refresh

if you wish the above to be timed, you need to call it with a setTimeout():

function refreshFrame(frameName)
{
eval('parent.' + frameName + '.location.reload()' );
}

init(frameName)
{
refreshFrame(frameName);
setTimeout('init(' + frameName + '),120)
}

note: change the framename in the onLoad event handler to what you what. Also, change the '120' to whatever time you want.

Vinny

Where the world once stood
the blades of grass cut me still

They have: 10 posts

Joined: Sep 2001

Where do I set the url to reload into the frame?

Thanks

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Sorry for the misunderstanding. Sad

See the response at:
http://www.webmaster-forums.com/showthread.php?postid=90222&t=3434#post90222

Vinny

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.