查看完整版本: 歡迎視窗 + 到訪次數

2-6-2012 09:21

歡迎視窗 + 到訪次數

<P><FONT color=blue>&lt;script type="text/javascript"&gt;&lt;!--<BR>function getCookieGS(offset){<BR>var endstr = document.cookie.indexOf (";", offset);<BR>if (endstr == -1)<BR>endstr = document.cookie.length;<BR>return unescape(document.cookie.substring(offset, endstr));}<BR>function GetCookie(name){<BR>var arg = name + "=";<BR>var alen = arg.length;<BR>var clen = document.cookie.length;<BR>var i = 0;<BR>while (i &lt; clen){<BR>var j = i + alen;<BR>if (document.cookie.substring(i, j) == arg)<BR>return getCookieGS (j);<BR>i = document.cookie.indexOf(" ", i) + 1;<BR>if (i == 0)<BR>break;}<BR>return null;}<BR>function SetCookie(name, value){<BR>var argv = SetCookie.arguments;<BR>var argc = SetCookie.arguments.length;<BR>var expires = (2 &lt; argc) ? argv[2] : null;<BR>var path = (3 &lt; argc) ? argv[3] : null;<BR>var domain = (4 &lt; argc) ? argv[4] : null;<BR>var secure = (5 &lt; argc) ? argv[5] : false;<BR>document.cookie = name + "=" + escape (value) +<BR>((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +<BR>((path == null) ? "" : ("; path=" + path)) +<BR>((domain == null) ? "" : ("; domain=" + domain)) +<BR>((secure == true) ? "; secure" : "");}<BR>var expdate = new Date();<BR>var count;<BR>expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));<BR>if(!(count = GetCookie("gscount")))<BR>count = 0;<BR>count++;<BR>SetCookie("gscount", count, expdate, "/", null, false);<BR>var message;<BR>if(count == 1) message="歡迎光臨笨網論壇!";<BR>if(count == 2) message="請share本站!";<BR>if(count == 3) message="笨笨網站歡迎你!";<BR>if(count == 4) message="請給本站一個讚!";<BR>if(count &gt;= 5) message="請多多指教!";<BR>alert("你是第 "+count+" 次到訪本站,"+message);<BR>// --&gt;&lt;/script&gt;</FONT></P>
<P><FONT color=#0000ff></FONT>&nbsp;</P>
<P>&nbsp;</P>
<P><FONT color=#0000ff></FONT>&nbsp;</P>
<P><FONT color=purple>以下句子可修改,每次到訪會出現不同歡迎字句</FONT></P>
<P><FONT color=purple></FONT>&nbsp;</P>
<P><FONT color=purple>if(count == 1) message="歡迎光臨笨網論壇!";<BR>if(count == 2) message="請share本站!";<BR>if(count == 3) message="笨笨網站歡迎你!";<BR>if(count == 4) message="請給本站一個讚!";<BR>if(count &gt;= 5) message="請多多指教!";<BR>alert("你是第 "+count+" 次到訪本站,"+message);</FONT></P>

<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></FONT>&nbsp;</P>

<script type="text/javascript"><!--
function getCookieGS(offset){
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));}
function GetCookie(name){
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen){
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieGS (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;}
return null;}
function SetCookie(name, value){
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");}
var expdate = new Date();
var count;
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
if(!(count = GetCookie("gscount")))
count = 0;
count++;
SetCookie("gscount", count, expdate, "/", null, false);
var message;
if(count == 1) message="歡迎光臨笨笨網站超級論壇!";
if(count == 2) message="請share本站出去!";
if(count == 3) message="笨笨網站歡迎你!";
if(count == 4) message="請給本站一個讚!";
if(count >= 5) message="請多多指教!";
alert("你是第 "+count+" 次到訪本站,"+message);
// --></script>

<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></FONT>&nbsp;</P>


<P><FONT color=#0000ff size=3>如不能顯示語法效果可貼去本站</FONT><A href="http://www.bunbun000.com/html/index.htm" target=_blank><FONT color=red size=3>語法測試板</FONT></A><FONT color=#0000ff size=3>試看</FONT></P>

25-5-2013 09:09

複製上列語法

<form name="copy">
<textarea cols="40" name="txt" rows="4" style="BACKGROUND-COLOR:#ffffff; COLOR:#000000; FONT-SIZE:9pt">
<script type="text/javascript"><!--
function getCookieGS(offset){
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));}
function GetCookie(name){
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen){
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieGS (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;}
return null;}
function SetCookie(name, value){
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");}
var expdate = new Date();
var count;
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
if(!(count = GetCookie("gscount")))
count = 0;
count++;
SetCookie("gscount", count, expdate, "/", null, false);
var message;
if(count == 1) message="歡迎光臨笨網論壇!";
if(count == 2) message="請share本站!";
if(count == 3) message="笨笨網站歡迎你!";
if(count == 4) message="請給本站一個讚!";
if(count >= 5) message="請多多指教!";
alert("你是第 "+count+" 次到訪本站,"+message);
// --></script>
</textarea><br>
<input onclick="javascript:this.form.txt.focus();this.form.txt.select();" type="button" value="全選">
</form>

<BR>

<script type="text/javascript"><!--
google_ad_client = "ca-pub-4078143172638881";
/* 336X280 */
google_ad_slot = "3268225205";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
頁: [1]
查看完整版本: 歡迎視窗 + 到訪次數