42 users online (1 members and 41 guests)  


  Results 1 to 3 of 3

Related

  1. Redirecting to URL    Forum: CGI Perl Forum
    Replies: 1
  2. Replies: 1
  3. Advanced Browser ~ Do you know of it.    Forum: General Discussion
    Replies: 4
  4. redirecting?    Forum: General Discussion
    Replies: 3
  5. Redirecting    Forum: Website Scripts Forum
    Replies: 3
  1. #1
    Saj's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Feb 2003
    Posts
    35

    Advanced redirecting in Javascript

    Hi.

    I'm trying to create a javascript which pretty much says: If visitor comes from page.html, then load the page. But if the visitor comes from any where else, then load otherpage.html.

    Any ideas?

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Code:
    document.referrer
    This contains the value of the referring document.

    However, it will not work if the page came from a hard disk, is typed in the address bar, or came from bookmarks.

    If you are using this for some kind of secure page, I highly recommend you use a server-side language instead.

    JavaScript security is like a chocolate kettle. It just dont work.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Saj's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Feb 2003
    Posts
    35
    ok thx, that works for me