Today, I encountered a very interesting problem. Because the company has cooperated with some vendors to close the issue, the websites of both parties will also exchange links. When the contract ends today, however, when the other party never links the link, this may sometimes lead to unnecessary misunderstandings, so that the average user thinks that there is still cooperation between the two parties, although this can make some traffic, it also causes some misunderstanding. Therefore, the first part of the article hopes to determine whether it can be used to reject it when it comes from the station, this led Mei Gan to move back to three steps. Originally, he thought that he had to set the settings from the host. After finding some files online, he discovered that only a few simple lines of Javascript would be used, you can capture the source and take preventive measures.
:
CopyCodeThe Code is as follows: <SCRIPT type = "text/JavaScript">
VaR refurl = Document. referrer;
If (refurl. indexof ("wowgame")>-1 ){
Alert ("your source URL is: [" + document. referrer + "] cooperation with this site has been terminated. ");
Location. Replace (refurl );
}
</SCRIPT>
In fact, the method is really very simple, so if you encounter this problem next time, you can try this method. Here, Mei Gan will direct it back to the webpage, and you can also spend more time, when determining that a website is connected, jump to a declaration to let the netizens know that the cooperation has been terminated, and by the way, they can earn some traffic.
Application Scope: It is generally used to check the keywords on the Source Page. It is generally used to determine the users who use the search engine and what keywords are entered and then judge. The link is provided in the lower right corner.
It is of great benefit for enhancing the user experience, allowing visitors to quickly find relevant information.