中文(繁体)
<!-- 將以下程式碼加入<body>區域 --> <script language=javascript> function getCookie(name) { var cookiefound=false var start=0 var end=0 var cookiestring=document.cookie;變數 i = 0; while (i<=cookiestring.length) { start=i end=start+name.length if (cookiestring.substring(start,end)==name) {cookiefound=true;休息;我++; } if (cookiefound==true) { 開始=結束+1; end=cookiestring.indexOf(";",start); if (end<start) { end=cookiestring.length;} return cookiestring.substring(start,end); } 回傳 ””; } function newcookie(id,value,guoqi) { var expires=new Date() expires.setTime(expires.getTime()+24*60*60*30*1000) //30為天數,可改為任意數字 var expiryDate=expires.toGMTString(); document.cookie=id+"="+value+";expires="+expiryDate } if (getCookie("Alerted")=="") {alert("彈出了") newcookie("Alerted","yes") }否則{}</腳本>