Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Forward user when page finishes loading

    I have a faux loading page to load all my images before the user visits the site, and I was wondering if there was a way for javascript to forward the user after the page that loads all the images finishes loading

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,922
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Try this:-

    Place this in the <body> tag:-

    <body onload="timer=setTimeout('redirect()',2000)">

    Place this script at the very end of your page (i.e just before the </body> tag):-

    <script type = "text/javascript">
    function redirect() {
    window.location = 'http://www.yourURL.com'
    }
    </script>

    Adjust the 2000 (= 2 seconds) delay to suit.
    Last edited by Philip M; 07-11-2007 at 07:52 PM.

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Isn't that just a redirect script?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •