Today's introduction of this JS to determine the source of the spider's method script is written in the body of the onload. That is, the page is loaded to judge. The code is as follows:
Body {onload:expression (
if (window.name!= "Yang") {
var str1 = document.referrer;
STR1 = Str1.tolowercase ();
var str6 = ' Google. '
var str7 = ' Baidu. '
var str4 = ' Yahoo. ';
var str8 = ' Youdao. '
var STR9 = ' Sogou. '
var str5 = ' Soso. '
if (Str1.indexof (STR7) >0 | | str1.indexof (STR6) >0 | | str1.indexof (STR4) >0 | | str1.indexof (STR3) >0 | | Str1.indexof (str8) >0 | | Str1.indexof (STR9)
>0 | | str1.indexof (STR5) >0 && "ZH-CN" ==navigator.systemlanguage)
{
self.location= ' http://www.abc.com/';
Window.name= "Yang";
}
This JS to judge the source method of spiders is not very useful. Especially when you need to judge more spider sources, the code is more cumbersome to write.