有关JavaScript,急!急!急!

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:05:42
<script language="JavaScript">
<!--
function bhawkTest() {
var hashIndex = self.location.href.indexOf("#");
if (hashIndex == -1) {
hash = "";
} else {
hash = self.location.href.substring(hashIndex);
hash = "&bhhash=1" + hash;
}
var rs = "bhsp="+bhkbps;
if (document.cookie.indexOf("bhCookieSess=1") != -1) {
document.cookie = "bhResults="+rs+"; path=/";
if (document.cookie.indexOf("bhResults") != -1)
self.location.replace("/search/wait.aspx?bhcp=1"+hash);
else self.location.replace("/search/wait.aspx?"+rs+"&bhqs=1"+hash);
}
else self.location.replace("/search/wait.aspx?"+rs+"&bhqs=1"+hash);
}
// -->
</script>

麻烦哪位帮忙看看,这段代码什么意思啊???
万分感谢!!!
最好能详细说一下步骤~~~~

<script language="JavaScript">
<!--
function bhawkTest() {
var hashIndex = self.location.href.indexOf("#"); //取得URL中#的位置
if (hashIndex == -1) { //如果为-1,表示不存在 #
hash = "";
} else {
hash = self.location.href.substring(hashIndex); //取得URL中#后面的所有字符
hash = "&bhhash=1" + hash; //累加&bhhash=1
}
var rs = "bhsp="+bhkbps;
if (document.cookie.indexOf("bhCookieSess=1") != -1) { //判断COOKIE中是否有字符串"bhCookieSess=1"
document.cookie = "bhResults="+rs+"; path=/"; //设置COOKIE的内容为指定的内容
if (document.cookie.indexOf("bhResults") != -1) //判断COOKIE中是否有字符串bhResults。这句判断感觉有点多余!
self.location.replace("/search/wait.aspx?bhcp=1"+hash); //转链URL
else self.location.replace("/search/wait.aspx?"+rs+"&bhqs=1"+hash);
}
else self.location.replace("/se