<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

	<title> Test </title>
	
	<script language='javascript'>
		redirTime = "5000";
		redirURL = "/common/index.php";
		function redirTimer() { 
			self.setTimeout("self.location.href redirURL;",redirTime);
		}
	</script>
</head>

<body>
<script language='javascript'>

onload="redirTimer()" 
</script>
</body>
</html>

Recommended Answers

All 3 Replies

try modifying your code like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

	<title> Test </title>
	
	<script language='javascript'>
		redirTime = "5000";
		redirURL = "/common/index.php";
		function redirTimer() { 
			self.setTimeout("self.location.href = redirURL;",redirTime);
		}
	</script>
</head>

<body onload="redirTimer();" >

</body>
</html>

make some changes...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
      <html>

      <head>
 
      <title> Test </title>
  
      <script language='javascript'>
   
      redirTime = "5000";
  
      redirURL = "b.html";
  
      function redirTimer() {
  
      self.setTimeout("self.location.href=redirURL;",redirTime);
	  //navigator.location.href="b.html";
  
      }
  
      </script>
  
      </head>
  
      <body>
  
      <script language='javascript'>
  
      redirTimer();  
      </script>
 
      </body>
  
      </html>

solved. thx

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.