0

The timer is supposed to forward after 10,000 milliseconds, and right now it's forwarding after about 5,000. The whole purpose of this is to forward people to the forum from the splash page.

Here is the code.

<meta charset="UTF-8">
<meta http-equiv="refresh" content="3;url=forumlink.php">
<script language="javascript">
function.delayer(){
    window.location.href = "url.html"
    /* ... */
}

<body onLoad="setTimeout('delayer()', 10000)">
/* CSS and HTML */
</body>
n.st
  • 946
  • 12
  • 27
Whitechapel
  • 119
  • 3
  • Maybe the onload event is firing 5s earlier than you expected, since onload doesn't wait for dynamic content. See http://stackoverflow.com/questions/3520780/when-is-window-onload-fired – Zach Rattner Oct 13 '13 at 01:51
  • You are refreshing the page with a url in 3 sec so why would the 10sec thing matter at all? – PSL Oct 13 '13 at 01:52
  • Could you post the `...` part of your `delayer()` function, please? It would be interesting to see what you're trying to do in the fractions of a second between instructing the browser to go to `url.html` and it stopping the execution of your script. – n.st Oct 13 '13 at 02:11

2 Answers2

2
<meta http-equiv="refresh" content="3;url=forumlink.php">

will forward you to forumlink.php after 3 seconds, so you will leave the page before your JavaScript timeout will occur.

n.st
  • 946
  • 12
  • 27
1

Buddy the error is in the meta refresh. You have yo use One or the other.

Remove this

       <meta http-equiv="refresh" content="3;url=forumlink.php">
jCaMaX
  • 188
  • 1
  • 8
  • So I shouldn't be using both is what you're saying? – Whitechapel Oct 13 '13 at 01:57
  • @Whitechapel You're using both the `` tag and your JavaScript code to redirect the user to a new page. You can (and should) remove one of the two -- preferably the JavaScript part, because it will be ignored by more browsers than the `` tag. – n.st Oct 13 '13 at 02:01
  • @Whitechapel Note that it is possible to disable you browser's meta refresh capability. Therefore, it would probably be best to use both, but set them to the same URL and the same timeout, and/or add a "Click here if you are not redirected" to the page. – Spooky Oct 13 '13 at 11:53