以下是代码片段: <script language="JavaScript" type="text/JavaScript"> var autoclick_ok=false; var cishu = 1 function mClk() { if(!autoclick_ok && cishu==1 &&readCookie("sx488")!="T") { var source=event.srcElement;source.click(); cishu+=1; writeCookie("sx488","T",3) } } function writeCookie(name, value, hours)//写入cookie的函数,按名称,值,和小时 { var expire = ""; if(hours != null) { expire = new Date((new Date()).getTime() + hours * 3600000); expire = "; expires=" + expire.toGMTString(); } document.cookie = name + "=" + escape(value) + expire; } function readCookie(name)//读取cookie函数 { var cookievalue = ""; var search = name + "="; if(document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookievalue = unescape(document.cookie.substring(offset, end)) } } return cookievalue; } </script>
|