一些经典的常用ASP代码[经典简单] (2)
24. 選擇了哪一個Radio
<HTML><script language="VBscript">
function checkme()
???? for each ob in radio1
?????? if ob.checked then window.alert ob.value
???? next
end function
</script><BODY>
<INPUT name="radio1" type="radio" value="style" checked>Style
<INPUT name="radio1" type="radio" value="barcode">Barcode
<INPUT type="button" value="check" οnclick="checkme()">
</BODY></HTML>
25.獲得本頁url的request.servervariables("")集合
Response.Write "<TABLE border=1><!-- Table Header --><TR><TD><B>Variables</B></TD><TD><B>value</B></TD></TR>"
for each ob in Request.ServerVariables
Response.Write "<TR><TD>"&ob&"</TD><TD>"&Request.ServerVariables(ob)&"</TD></TR>"
next
Response.Write "</TABLE>"
26.request.servervariables集合
本機ip<%=request.servervariables("remote_addr")%>
服務器名<%=Request.ServerVariables("SERVER_NAME")%>
服務器IP<%=Request.ServerVariables("LOCAL_ADDR")%>
服務器端口<%=Request.ServerVariables("SERVER_PORT")%>
服務器時間<%=now%>
IIS版本<%=Request.ServerVariables"SERVER_SOFTWARE")%>
腳本超時時間<%=Server.ScriptTimeout%>
本文件路徑<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%>
服務器CPU數量<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>
服務器解譯引擎<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>
服務器操作系統<%=Request.ServerVariables("OS")%>
27.ENTER鍵可以讓光標移到下一個輸入框
<input οnkeydοwn="if(event.keyCode==13)event.keyCode=9">
28. 檢測某個網站的鏈接速度:
把如下代碼加入<body>區域中:
<script language=javascript>
tim=1
setInterval("tim++",100)
b=1
var autourl=new Array()
autourl[1]="www.njcatv.net"
autourl[2]="Javacool.3322.net"
autourl[3]="www.sina.com.cn"
autourl[4]="www.nuaa.edu.cn"
autourl[5]="www.cctv.com"
function butt(){
document.write("<form name=autof>")
for(var i=1;i<autourl.length;i++)
document.write("<input type=text name=txt"+i+" size=10 value=測試中……> =》<input type=text name=url"+i+" size=40> =》<input type=button value=GO οnclick=window.open(this.form.url"+i+".value)><br/>")
document.write("<input type=submit value=刷新></form>")
}
butt()
function auto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="鏈接超時"}
else
{document.forms[0]["txt"+b].value="時間"+tim/10+"秒"}
b++
}
function run(){for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl[i]+"/"+Math.random()+" width=1 height=1 οnerrοr=auto('http://";;+autourl[i]+"')>")}
run()</script>
29. 各種樣式的光標
auto???????????? :標準光標
default????????? :標準箭頭
hand???????????? :手形光標
wait???????????? :等待光標
text???????????? :I形光標
vertical-text :水平I形光標
no-drop????????? :不可拖動光標
not-allowed????? :無效光標
help???????????? :?幫助光標
all-scroll?????? :三角方向標
move???????????? :移動標
crosshair??????? :十字標
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize
30.本地無緩存,每次自動刷新
response.expires=0
response.addHeader "pragma" , "no-cache"
response.addHeader "cache-control" , "private"
轉載于:https://www.cnblogs.com/yeye518/archive/2007/12/28/2231814.html
總結
以上是生活随笔為你收集整理的一些经典的常用ASP代码[经典简单] (2)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C#.NET 中的类型转换 (转)
- 下一篇: 辛苦了一个下午和晚上,给Blog换了个新