Home  >  Article  >  Web Front-end  >  Javascript document.referrer determines the visitor’s source URL_javascript skills

Javascript document.referrer determines the visitor’s source URL_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:38:531319browse

I encountered a very interesting problem today. Since the company has cooperative relations with some manufacturers, links will be exchanged on both sides' websites. When the contract was terminated today, but the other party never removed the link part, this sometimes happens. It will cause some unnecessary misunderstandings, making ordinary users think that the two parties still have a cooperative relationship. Although this can earn some traffic, it also causes some misunderstandings, so the higher-ups hope to be able to judge the use of it. When the station came, they rejected it at the door, which made Mei Gan take three steps back. Originally, she thought that she had to set it up from the host computer. After searching for some documents on the Internet, she found that she could just use a few simple lines of javascript. Catch the source of use and take some preventive measures.
Rendering:

梅問題-javascript教學-判斷使用者來源

Copy code The code is as follows: