Hello all!

So I am creating a redirect page so that when someone signs up for our newsletter they're taken to this page and 10 seconds later, redirected to another page.

The script I'm using isn't working for some reason. I originally had it in a seperate .js file but put it in the text to reference it more easily.

Still nothing. Any ideas?

<html>

	<head>
		<link rel="stylesheet" href="../maiccss/index.css" type="text/css" media="screen">
		<link rel="stylesheet" href="../maiccss/indexprint.css" type="text/css" media="print">
		<title>MAIC Newsletter and Updates Subscription Form</title>
        
        <script language="JavaScript" type="text/javascript">
        
        function timer {

			var goToTimer;
		
		goToTimer=setTimeout("goTo()",10000)	

		<!-- After 10 seconds the page changes -->
		
		function goTo() {
		
		document.location.href="subscribeJ.asp"
		
		}
	
}
        
        
        </script>

    <!--
    
    Should only be on this page for 10 seconds.
    
    --> 
    
	</head>

	<body onload = "timer">
		<!--#include virtual="include/header.htm" -->
		<!--#include virtual="include/skyscraper.htm" -->


				
					
				<p><b>Your subscription has been sent!</b></p>
				<p><b><i>Shortly, you will receive an email from our listing service: LISTSERV.JMU.EDU. Follow the instructions contained in the email to confirm your subscription request. Thank you for subscribing.</i></b></p>
                
                <p>
                You will be redirected automatically in 10 seconds.  If this does not occur, please click this link <a href="subscribeJ.asp">.</a>
                
                
                </p>
			<div class="center">
				<!--#include virtual="include/footer.htm" -->
			</div>

	</body>

</html>

Recommended Answers

All 2 Replies

it needs to be:

<script language="JavaScript" type="text/javascript">
		
function goTo() {
	document.location.href="subscribeJ.asp";
}


window.onload=function(){
	setTimeout(function(){ goTo(); },10000);
}	
</script>

and the body should just be:

<body>

~G

This

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <meta http-equiv="refresh" content="10;url=subscribeJ.asp">
    <link rel="stylesheet" href="../maiccss/index.css" type="text/css" media="screen">
    <link rel="stylesheet" href="../maiccss/indexprint.css" type="text/css" media="print">
    <meta name="generator" content="HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
    <title>
      MAIC Newsletter and Updates Subscription Form
    </title>
  </head>
  <body>
    <!--#include virtual="include/header.htm" -->
    <!--#include virtual="include/skyscraper.htm" -->
    <p>
      <b>Your subscription has been sent!</b>
    </p>
    <p>
      <b><i>Shortly, you will receive an email from our listing
      service: LISTSERV.JMU.EDU. Follow the instructions contained
      in the email to confirm your subscription request. Thank you
      for subscribing.</i></b>
    </p>
    <p>
      You will be redirected automatically in 10 seconds. If this
      does not occur, please click <a href="subscribeJ.asp">here</a>.
    </p>
    <div class="center">
      <!--#include virtual="include/footer.htm" -->
    </div>
  </body>
</html>

will do what you want even if javascript is not available [assuming that the relative URLs - which I couldn't test - are valid, of course].

Note: a "clickable" link consisting of a single period isn't exactly user-friendly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.