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

Simple html redirect code? 1

Status
Not open for further replies.

jrpatdlgs

Programmer
Joined
Mar 28, 2000
Messages
62
Location
US
Can someone please refresh my memory on the html code and timing string that will automatically redirect a user to another page on the site? I used it once several years ago but that page is long gone and all I can find now are Javascript redirects which I do not understand.

Thanks,
John
 
[tt]try this
Code:
<html><head><title>HTML REDIRECT</title>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta http-equiv=REFRESH content="5; &#10;URL=http://www.mysite.com">

blah blah blah
[/tt]
 
and with the simplest JavaScript ever.


Code:
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

[blue]redirTime = "15000";[/blue]
redirURL = "your_page.asp";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
</script>


<!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->

<BODY onLoad="redirTimer()">


Just change the [blue]redirTime = "15000";[/blue] to whatever time you need. Right now it's set to 15 seconds...
 
Thank you DeCojute. The html code works perfectly. And now I even have a simple enough Javascript so I can give it a try too. Have a great day! : ^ )

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top