叶子树logo
首 页 技术教程 新闻资讯 网站展示 酷站欣赏 下载中心 站长故事 信息互动 论坛交流
Web www.webshu.net
 
  最新推荐→

 
  最新热门→

 
  相关文章→
 您现在的位置: 叶子树 >> 技术教程 >> 网页制作 >> FrontPage教程 >> 正文

时钟广告跳转状态栏等JS代码

作者:佚名    文章来源:不详    点击数:    更新时间:2008-4-11           

 

<% if request("infoid")<>"" then set rs=conn.execute("select * from nproduct where id="&request("infoid")) if not (rs.eof and rs.bof) then proname=rs("proname") content=rs("proinfo") end if rs.close set rs=nothing end if %>

1、判断网页是否过期 getTime()
用于实现广告过期. 

<head>
<h1>判断网页是否过期</h1>
<hr>
<script>
<!--
today = new Date() //取得现在的时间
TheDay = new Date(2005,12,31) //取得结束的时间 2006/1/4 00:00:00
//如果 today.getTime() > TheDay.getTime()
if (today.getTime()>TheDay.getTime())
{
document.write(’<h1>抱歉,你访问的网页已经过期!</h1>’) }
else
{
document.write(’<font size=5>你的网页尚未过期.</font>’)
}
//-->
</script>

2、在线时钟实例 setTimeout()函数
<head>
<script>
<!--
function showtime()
{
 document.CLOCK.ALARM.value = new Date().toString()
 TimerID = setTimeout("showtime()",1000)
}
//-->
</script>
</head>
<body onLoad="showtime()">
<Form name="CLOCK">
<input name="ALARM" type="text" size="45" value="">
如无效果请刷新
</form>
</body>
其中:setTimeout()函数
TimerID = setTimeout(’showtime’,1000)
通过setTimeout 来刷新时间 间隔1000=1秒
3、status window自带函数状态栏提示
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script>
<!--
window.defaultStatus="这里是主页"
//-->
</script>
</head>
<body>
<a href="abc.htm" onmouseover=’window.status="abc.htm";return true’>abc</a><br>
<a href="def.htm" onmouseover=’window.status="def.htm";return true’>def</a>
</body>
</html>
4、setTimeout 函数,自动链向新网站
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function Redir()
{
a ="http://homepage.yesky.com" //在此输入新网站的网址
TimerID=setTimeout(’window.location.href=a’,2000)
}
//-->
</script>
</head>
<body onload="Redir()">
我们的网站搬新家了!请单击下面的超链接进入我们的新网站<br>
<a href="http://homepage.yesky.com">网页陶吧</a>
<br> 2秒后自动进入新的网站,请耐心等待。
</body>
</html>

5、广告字幕实例
<head>
<script>
<!--
var ShowString =" " 
 +"Space,The final frontier... These are the"
       +"voyages of the Starship Enterprise, its"
       +"continuing mission: to explore strange"
       +"new worlds, to seek out new life and new"
       +"civilizatins, to boldly go where no man"
       +"has gone before.______________________________"

[1] [2] 下一页

叶子树:www.webshu.net
  • 下一篇文章:

  • 文章录入:webshu    责任编辑:webshu 
    叶子树(www.webshu.net)所有资料源于作者发布或网友推荐收集整理而来,仅供学习使用,版权归原作者所有,如有侵权,请您联系我们,我们将尽快更正。

      网友评论:(评论内容只代表网友观点,与本站立场无关!) 发表评论

    友情链接 | 留言互动 | 版权声明
    Copyright©All return the ye ze shu and www.webshu.net   
    本站广告服务请加QQ:904166(超越-激情)
    京ICP备05086028号  把"叶子树" 与你的好友一起分享!