⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c0001.htm

📁 JavaScript源代码全集
💻 HTM
字号:
<!--Saved  from《天索星网》http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!-- A:link {text-decoration: none; color:#000000}
     A:visited {text-decoration: none; color: #000000}
     A:active {text-decoration: none; color: #FF0000}
     A:hover {text-decoration: underline; color: FF0000}
     body{font-size=9pt}
	    TH{FONT-SIZE: 9pt}
       TD{ FONT-SIZE: 9pt}-->
</style>
<script LANGUAGE="JavaScript">
<!-- Begin
var expDays = 30;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function Who(info){
var VisitorName = GetCookie('VisitorName')
if (VisitorName == null) {
VisitorName = prompt("您的姓名:");
SetCookie ('VisitorName', VisitorName, exp);
}
return VisitorName;
}
function When(info){
var rightNow = new Date()
var WWHTime = 0;
WWHTime = GetCookie('WWhenH')
WWHTime = WWHTime * 1
var lastHereFormatting = new Date(WWHTime);
var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
var lastHereInDateFormat = "" + lastHereFormatting;
var dayOfWeek = lastHereInDateFormat.substring(0,3)
var dateMonth = lastHereInDateFormat.substring(4,11)
var timeOfDay = lastHereInDateFormat.substring(11,16)
var year = lastHereInDateFormat.substring(23,25)
var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDay
SetCookie ("WWhenH", rightNow.getTime(), exp)
return WWHText
}
function Count(info){
var WWHCount = GetCookie('WWHCount')
if (WWHCount == null) {
WWHCount = 0;
}
else{
WWHCount++;
}
SetCookie ('WWHCount', WWHCount, exp);
return WWHCount;
}
function set(){
VisitorName = prompt("你是谁?");
SetCookie ('VisitorName', VisitorName, exp);
SetCookie ('WWHCount', 0, exp);
SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (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 getCookieVal (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 = (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)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
//  End -->
</script>

<title>《网络教程》之Javascript--告诉你最后一次来的时间</title>
</head>

<body topmargin="0" leftmargin="0">
<div align="center"><center>

<table border="0" width="90%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" colspan="3" height="62"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="250"><img src="../photo/jx.gif" border="0" WIDTH="200" HEIGHT="80"></td>
        <td width="468" height="60"></td>
      </tr>
    </table>
    </center></div></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#C8C882" valign="middle" align="center" height="22"></td>
    <td width="80%" bgcolor="#C8C882" valign="middle" align="center" colspan="2" height="22"><strong><span style="font-size: 10pt; font-family: Arial">javascript COOKIE类</span></strong></td>
  </tr>
  <tr>
    <td width="20%" valign="top" align="left" height="242"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">时间类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">文字类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">导航类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">鼠标类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">按钮类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">跑马灯</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm"><strong><font face="Arial">COOKIE</font></strong>类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">其他类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="10" bgcolor="#505028"></td>
      </tr>
    </table>
    </center></div></td>
    <td width="80%" valign="top" align="left" colspan="2" height="242"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" bgcolor="#EBEBEB" valign="middle" align="center" height="18" colspan="3">告诉你最后一次来的时间</td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="2" colspan="3"></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="1" colspan="3" bgcolor="#000080"></td>
      </tr>
      <tr>
        <td width="12%" valign="middle" align="center" height="22"></td>
        <td width="67%" valign="middle" align="center" height="22"><script LANGUAGE="JavaScript">
if (Count()==0)
{
document.write("您好!" + Who() + ". 欢迎您第一次来这儿.");
}
else
{
document.write("您好!" + Who() + ". 您已来这儿 " + Count() + "次了,最后一次在 " + When() +".");
}
</script></td>
        <td width="12%" valign="middle" align="center" height="22"></td>
      </tr>
      <tr>
        <td width="12%" valign="middle" align="center" height="20"></td>
        <td width="67%" valign="middle" align="center" height="20"></td>
        <td width="12%" valign="middle" align="center" height="20"></td>
      </tr>
      <tr>
        <td width="12%" valign="middle" align="center" height="22" rowspan="4"></td>
        <td width="67%" valign="middle" align="left" height="6" bgcolor="#F0FAFF"><span style="font-size: 9pt; color: rgb(255,0,0)">第一步:拷贝下面的代码到你的html文件的&lt;head&gt;和&lt;/head&gt;之间</span></td>
        <td width="12%" valign="middle" align="center" height="22" rowspan="4"></td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="center" height="6" bgcolor="#F0FAFF"><form name="copy1">
          <p><textarea rows="6" name="S1" cols="40" onMouseOver="this.focus()" onFocus="this.select()">&lt;script LANGUAGE=&quot;JavaScript&quot;&gt;
<!-- Beginvar expDays = 30;var exp = new Date(); exp.setTime(exp.getTime() + (expDays*24*60*60*1000));function Who(info){var VisitorName = GetCookie('VisitorName')if (VisitorName == null) {VisitorName = prompt("您的姓名:");SetCookie ('VisitorName', VisitorName, exp);}return VisitorName;}function When(info){var rightNow = new Date()var WWHTime = 0;WWHTime = GetCookie('WWhenH')WWHTime = WWHTime * 1var lastHereFormatting = new Date(WWHTime);var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()var lastHereInDateFormat = "" + lastHereFormatting;var dayOfWeek = lastHereInDateFormat.substring(0,3)var dateMonth = lastHereInDateFormat.substring(4,11)var timeOfDay = lastHereInDateFormat.substring(11,16)var year = lastHereInDateFormat.substring(23,25)var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDaySetCookie ("WWhenH", rightNow.getTime(), exp)return WWHText}function Count(info){var WWHCount = GetCookie('WWHCount')if (WWHCount == null) {WWHCount = 0;}else{WWHCount++;}SetCookie ('WWHCount', WWHCount, exp);return WWHCount;}function set(){VisitorName = prompt("Who are you?");SetCookie ('VisitorName', VisitorName, exp);SetCookie ('WWHCount', 0, exp);SetCookie ('WWhenH', 0, exp);}function getCookieVal (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 getCookieVal (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 = (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)) +  ((domain == null) ? "" : ("; domain=" + domain)) +    ((secure == true) ? "; secure" : "");}function DeleteCookie (name) {  var exp = new Date();  exp.setTime (exp.getTime() - 1);  var cval = GetCookie (name);  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();}//  End -->
&lt;/script&gt;
</textarea></p>
        </form>
        </td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" height="5" bgcolor="#F0FAFF"><span style="font-size: 9pt; color: rgb(255,0,0)">第二步:拷贝下面的代码到你的html文件的&lt;body&gt;和&lt;/body&gt;之间</span></td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" height="5" bgcolor="#F0FAFF">&lt;script 
        LANGUAGE=&quot;JavaScript&quot;&gt;<br>
        if (Count()==0)<br>
        {document.write(&quot;您好!&quot; + Who() + &quot;. 欢迎您第一次来这儿.&quot;);}<br>
        else<br>
        {document.write(&quot;您好!&quot; + Who() + &quot;. 您已来这儿 &quot; + Count() + 
        &quot;次了,最后一次在 &quot; + When() +&quot;.&quot;);}<br>
        &lt;/script&gt;</td>
      </tr>
    </table>
    </center></div></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="20"></td>
    <td width="60%" height="20"></td>
    <td width="20%" height="20"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="17"></td>
    <td width="60%" height="17"><p align="center"><a href="c0002.htm"><span style="font-size: 9pt">下一页</span></a></td>
    <td width="20%" height="17"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="14"></td>
    <td width="60%" height="14"></td>
    <td width="20%" height="14"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="14"></td>
    <td width="60%" height="14"></td>
    <td width="20%" height="14"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="47"></td>
    <td width="60%" height="47"><div align="center"><center><table cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><p align="center"><font color="#969696"><span style="font-size: 9pt">《天索星网》 
        星网制作 版权所有</span></font></td>
      </tr>
      <tr>
        <td width="100%"><p align="center"><font color="#969696"><span style="font-size: 9pt; font-family: Arial">&copy;2000-2001 All Rights Reserved</span></font></td>
      </tr>
      <tr>
        <td width="100%"></td>
      </tr>
    </table>
    </center></div></td>
    <td width="20%" height="47"></td>
  </tr>
</table>
</center></div>
</body>
</html>
<!--Saved  from天索星网  版权所有;http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -