Web Analytics Made Easy -
StatCounter redirect in 5 seconds - CodingForum

Announcement

Collapse
No announcement yet.

redirect in 5 seconds

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • redirect in 5 seconds

    Hi there i want to redirect my users using Javascript. The script i want to redirect to another page after 5 seconds. I want the code to be as small as possible. the best it would be if it was one line..........
    Thx

  • #2
    Is it to be javascript by all means?

    ...'cose you have the smallest possible pure HTML solution. In head add:

    <meta http-equiv="refresh" content="5; Url=new url">
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

    Comment


    • #3
      Anyway, You can try this:

      <script>
      function r(a){
      if(a==undefined ){setTimeout('r(0)',5000)}
      else{window.location='new_url'}
      }
      window.onload = r;
      </script>

      You may choose which other event you want instead of window.onload
      KOR
      Offshore programming
      -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

      Comment

      Working...
      X