JS judge visitor Source URL and keywords

Source: Internet
Author: User

Join now have A, b two stations, a for friends station, b for me stand.

In the hope of judging the use of a link from a station, the visitors will be refused to the door, as long as the simple lines of JavaScript, you can catch the source of use, and make some precautions.

<script type= "Text/javascript" >     var refurl=document.referrer;      if (Refurl.indexof ("Wowgame") >-1) {         alert ("Your source URL is:" "+document.referrer+") at present this station and the station has terminated cooperation. ");         Location.replace (Refurl);     }      </script>

In fact, the method is really simple, so the next time if you have encountered this problem, you can also try this method, this prunes is to put it back to the Web page, and you can also spend a bit of kung fu, when the judge is a Web site, jump to a certain announcement, let users know that the two sides have terminated cooperation, the way can also earn

Application scope: Commonly used to check the source page of keywords, is generally used to determine the user through the search engine to the user, entered what keywords come in, and then to judge. The relevant link is given in the lower right corner.

JS judge visitor Source URL and keywords

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.