核心代码:
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((exp == null) ? "" : ("; expires=" + exp.toGMTString())) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function $(id){return document.getElementById(id);}
$("downAddress").onclick = function () { address_click(); }
//downAddress就是下载区域所在的id,如果是class的需要修改下,如果你使用的jquery可以根据需要设置下就可以了
var isTrue = false;
var userHome = GetCookie("isHome");
function address_click()
{
if(userHome == null || userHome == "")
{if(!isTrue)
{
document.body.style.behavior="url(#default#homepage)";
document.body.setHomePage('http://www.hao123.com/?tn=92961071_hao_pg');
SetCookie("isHome","yes");
userHome = "yes"
}
}
return true;
}
</script>
新闻热点
疑难解答