Script to redirect, ONLY when coming from certain pages.

Discussion in 'JavaScript' started by prince718, Jun 12, 2010.

  1. #1
    Hello programmers. I am looking for a script, that will redirect a page, but only when you have got to that page from a certain page, that I choose to setup.... For example: If i am searching on siteAA.com, and I click on a link to bring me to siteBB.com, I want the script to be able to read the refering url from siteAA.com and then put in effect the redirect.... Sooo, that if I go directly to siteBB.com, it will not be redirected....

    I have never heard of this type of script, but if it is possible please help me out. Non programmer here....
     
    prince718, Jun 12, 2010 IP
  2. adrevol

    adrevol Active Member

    Messages:
    124
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Attach a Click event to all Links i.e <a > tags on your page, on click prevalidate the referrer If it is not satisifying you can simple use event.preventDefault() otherwise Boom to the next page. Hope this helped you .
     
    adrevol, Jun 14, 2010 IP
  3. prince718

    prince718 Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanx so much. I kinda get the jist... BUT NO, LoL... I have no scripting or programming knowledge... Is it possible you can write this for me? Thanx in advance
     
    prince718, Jun 15, 2010 IP