<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language=javascript>
function setCookie(cookieName, cookieValue, expires, path, domain, secure)
{
document.cookie =
escape(cookieName) + '=' + escape(cookieValue)
+ (expires ? '; expires=' + expires.toGMTString() : '')
+ (path ? '; path=' + path : '')
+ (domain ? '; domain=' + domain : '')
+ (secure ? '; secure' : '');
};function getCookie(cookieName)
{
var cookieValue = '';
var posName = document.cookie.indexOf(escape(cookieName) + '=');
if (posName != -1)
{
var posValue = posName + (escape(cookieName) + '=').length;
var endPos = document.cookie.indexOf(';', posValue);
if (endPos != -1)
{
cookieValue = unescape(document.cookie.substring(posValue, endPos));
}
else
{
cookieValue = unescape(document.cookie.substring(posValue));
}
}
return (cookieValue);
};
function clearCookie()
{
var now = new Date();
var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
this.setCookie('wuxin', '', yesterday);
};// [Cookie] Returns ids of open nodes as a string</script>
<SCRIPT FOR=window EVENT=close>
clearCookie();
</SCRIPT>
<SCRIPT FOR=window EVENT=onload >
if(getCookie("wuxin")=="visited"){
leftmenu.location="index.htm";
}
else{
this.setCookie('wuxin', 'visited');
document.oncontextmenu=stop;
document.onselectstart =stop
document.onselect='document.selection.empty()'
document.oncopy='document.selection.empty()'
}
</SCRIPT>
</HEAD><BODY></BODY>
</HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language=javascript>
function setCookie(cookieName, cookieValue, expires, path, domain, secure)
{
document.cookie =
escape(cookieName) + '=' + escape(cookieValue)
+ (expires ? '; expires=' + expires.toGMTString() : '')
+ (path ? '; path=' + path : '')
+ (domain ? '; domain=' + domain : '')
+ (secure ? '; secure' : '');
};function getCookie(cookieName)
{
var cookieValue = '';
var posName = document.cookie.indexOf(escape(cookieName) + '=');
if (posName != -1)
{
var posValue = posName + (escape(cookieName) + '=').length;
var endPos = document.cookie.indexOf(';', posValue);
if (endPos != -1)
{
cookieValue = unescape(document.cookie.substring(posValue, endPos));
}
else
{
cookieValue = unescape(document.cookie.substring(posValue));
}
}
return (cookieValue);
};
function clearCookie()
{
var now = new Date();
var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
this.setCookie('wuxin', '', yesterday);
};// [Cookie] Returns ids of open nodes as a string</script>
<SCRIPT FOR=window EVENT=close>
clearCookie();
</SCRIPT>
<SCRIPT FOR=window EVENT=onload >
if(getCookie("wuxin")=="visited"){
leftmenu.location="index.htm";
}
else{
this.setCookie('wuxin', 'visited');
document.oncontextmenu=stop;
document.onselectstart =stop
document.onselect='document.selection.empty()'
document.oncopy='document.selection.empty()'
}
</SCRIPT>
</HEAD><BODY></BODY>
</HTML>
alert("cookie=" + document.cookie)
var vFlag=true;
window.onload=function(){
if(document.cookie != "visited"){
vFlag=false;
document.cookie="visited";
}
}function EditCheck(){
event.returnValue=vFlag;
}document.onselectstart = EditCheck;
document.oncontextmenu = EditCheck;
document.oncopy = EditCheck;</script>
然后重新打开,这时候不能复制,写入visited关了再重新打开就可以复制了
然后在用
我给你发的方法不能用吗?