网络编程
位置:首页>> 网络编程>> JavaScript>> 图片自动更新(说明)

图片自动更新(说明)

  发布时间:2024-04-28 09:46:51 

标签:图片自动更新(说明)

这是个“懒人”用的办法,你没有时间更新主页,却又不能让三个月前的更新还标着"new",那么用这个js可以帮你的大忙!
这个图片将在2000年1月1日自动消失。
copy下面的代码到你的html文件的<body>和</body>之间:


<script>
<!-- 
var imagetag='<img src="news.gif" alt="1">' var today=new Date() function expireat(expiredate){ var expire=new Date(expiredate) if (today.getTime()<=expire.getTime()) document.write(imagetag) } 
//-->
</script>
<script>
expireat("january 1, 2000")
</script>
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com