Results 1 to 2 of 2

Thread: History.back in JS

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    History.back in JS

    I will make a function, where I need information on the previous web page. Is there a document.location function where I can get this information? If the previous page is uk.htm then the language variable is "english". I have tried the code below, but it doesn't work? I only need information on which site was previous, I don't want to go back to this page.
    Code:
    function validate_website() {
    if (history.back() == "uk.htm") {
       language_var == "english"
       }
    }
    if (history.back() == "d.htm") {
       language_var == "german"
       }
    }
    }

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    try this

    if (history.previous.indexOf("uk.htm") != -1) { language_var = "english"}

    and if you want ot assign value to var use = not ==
    == is to compare

Posting Permissions

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



Click Here to Expand Forum to Full Width