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 2 of 2
  1. #1
    Jan
    Jan is offline
    Regular Coder
    Join Date
    Jul 2002
    Location
    Finland
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Random re-direct

    Hey y'all!

    Is it possible to make a page that randomly from a bunch of pages, re-directs the visitor to another page? I hope you all understood my question.

    Thankies!


    ~Jan

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    function rnd(x){return Math.floor(Math.random()*x)}
    var pages=new Array(
     "page1.html",
     "page2.html",
     "page3.html"
    )
    function redir(){
     location=pages[rnd(pages.length)]
    }


  •  

    Posting Permissions

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