如何随机显示图片计数器?
发布时间:2010-05-16 15:21:00
如何随机显示图片计数器?
一切就绪,看看我们的代码:
count.asp
< html >
< head >
< meta http-equiv="Content-Type"
content="text/html; charset=gb2312" >
<title>千变计数器 - aspxhome.com</title>
</head>
<body>
<p>
<%
dim out
countfile=server.mappath("aspcount.txt")
set objfile=server.createobject("scripting.filesystemobject")
' 定义一个服务器组件
set out=objfile.opentextfile(countfile,1,false,false)
counter=out.readline
' 读取数据
out.close
set objfile=server.createobject("scripting.filesystemobject")
set out=objfile.createtextfile(countfile,TRUE,FALSE)
application.lock
' 暂时琐定
counter=counter+1
' 访客次数加1
out.writeline(counter)
' 写入数据
application.unlock
' 解锁
out.close
%>
<script language="JavaScript">
function countdisp(countvar){
var countvar1="000000"+countvar;
' 实现随机显示,不足6位以0补全
var howFar1=countvar1.length;
countvar1=countvar1.substring(howFar1, howFar1-1)
var index=""+Math.floor(Math.random()*10);
if (index=="10"){
index="0"};
for (var icount=0;icount< 6;icount++={
var g=countvar1.substring(icount,icount+1);
document.images[icount].src="http://
localhost/images/"+index+g+".gif";
}
=
</script></p>
<!--预载图像数组-->
您是第<img src="https://www.aspxhome.com/images/00.gif" height=20 width=20>
<img src="https://www.aspxhome.com/images/00.gif" height=20 width=20>
<img src="https://www.aspxhome.com/images/00.gif"height=20 width=20>
<img src="https://www.aspxhome.com/images/00.gif"height=20 width=20>
<img src="https://www.aspxhome.com/images/00.gif"height=20 width=20>
<img src="https://www.aspxhome.com/images/00.gif"height=20 width=20>位访问者!
<script language="JavaScript">
count(counter);
' 调用count()函数,实现计数器的动态图像显示
</script>
</body>
</html>
猜你喜欢
- 起源当同一个远程服务器有多个人使用的时候,想知道服务器是否有人在用,我们不能直接的去登录,因为这样可能会把对方挤下来,这并不友好,所以这里提
- 为了减少大文件在数据库的存储对数据库的读写效率造成的压力,多了FileStream这一个功能,下面介绍一下如何快速使用FileS
- 例子一def filter(self, record): """Our custom
- 1、通过复制数据构造张量1.1 torch.tensor()torch.tensor([[0.1, 1.2], [2.2, 3.1], [4
- SQL语言是一门简单易学却又功能强大的语言,它能让你快速上手并写出比较复杂的查询语句。但对于大多数开发者来说,使用SQL查询数据库并没有一个
- 1. 为什么要查看梯度对于初学者来说网络经常不收敛,loss很奇怪(就是不收敛),所以怀疑是反向传播中梯度的问题(1)求导之后的数(的绝对值
- 一个Javascript 的类库,用于table内容排序。使用很方便,不用每次都去调用数据库了。特别适合多表查询的排序。加上<tbod
- 逐步回归的基本思想是将变量逐个引入模型,每引入一个解释变量后都要进行F检验,并对已经选入的解释变量逐个进行t检验,当原来引入的解释变量由于后
- 学了一个礼拜Python之后写的,代码很粗糙,只是为了完成利用163邮箱远程关电脑功能。直接把代码发上来吧。要执行的话得先安装一些模块,看i
- 1.window.event兼容脚本 2.屏蔽Form提交事件 3.获取事件源 4.添加事件兼容写法 5.Firefox注册innerTex
- 本文实例为大家分享了JS中FormData类实现文件上传的具体代码,供大家参考,具体内容如下上篇文章讲到了FormReader类实现文件上传
- 字符型图片验证码识别完整过程及Python实现的博主,我的大部分知识点都是从他那里学来的。想要识别验证码,收集足够多的样本后,首先要做的就是
- 导语昨天下班,回家吃完饭就直接躺了,无聊的时候大家都会干什么呢?当然是刷刷刷——抖音啦,嗯哼,然后返现了抖音上一款特效——「变身漫画」,简直
- 之前介绍过python开发工具Jupyter的使用,今天继续讲解python的数据类型,python中有整型、浮点型、字符串、布尔类型,我们
- 阅读上一篇:AJAX的jQuery实现入门(一)要写入数据库,我们知道的最简单的就是注册了, 就做个最简单的注册表单, 看看是如何提交数据的
- 接触Python时间不长,对有些知识点,掌握的不是很扎实,我个人比较崇尚不管学习什么东西,首先一定回去把基础打的非常扎实了,再往高处走。今天
- 方法1:自定义异常# -*- coding:utf-8 -*-"""功能:python跳出循环"&q
- 前言前面我们讲过了error类型来处理一般的错误,本文会描述使用panic函数和recover函数来处理比较极端的错误。简单来说,当程序运行
- js的eval代码快速解密有一段js代码内容如下:eval(function(E,I,A,D,J,K,L,H){function C(A)后
- 背景基于现在微服务或者服务化的思想,我们大部分的业务逻辑处理函数都是长这样的:比如grpc服务端:func (s *Service) Get