大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 网页设计 -> 经验技巧 -> CSDN 总结 精华 ASP 代码

CSDN 总结 精华 ASP 代码

时间: 2021-07-31 作者:daque

精炼asp代码(csdn)1.oncontextmenu="window.event.returnvalue=false"将完全樊篱鼠标右键<tableborderoncontextmenu=return(false)><td>no</table>可用来table 2.<bodyonselectstart="returnfalse">废除采用、提防复制3.onpaste="returnfalse"不准粘贴4.oncopy="returnfalse;"oncut="returnfalse;"提防复制5.<linkrel="shortcuticon"href="favicon.ico">ie地方栏前换成本人的图标6.<linkrel="bookmark"href="favicon.ico">不妨在保藏夹中表露出你的图标7.<inputstyle="ime-mode:disabled">封闭输出法8.长久城市带着框架<scriptlanguage="javascript"><!--if(window==top)top.location.href="frames.htm";//frames.htm为框架网页//--></script>9.提防被人frame<scriptlanguage=javascript><!--if(top.location!=self.location)top.location=self.location;//--></script>10.<noscript><iframesrc=*.html></iframe></noscript>网页将不许被另存为11.<inputtype=buttonvalue=察看网页源代码onclick="window.location='view-source:'+'<img src="http://www.okasp.com/techinfo/pic/url.gif" align=absmiddle border=0>http://www.csdn.net/">12.还好吗经过asp的本领来查看来访者能否用了代劳<%ifrequest.servervariables("http_x_forwarded_for")<>""thenresponse.write"<fontcolor=#ff0000>您经过了代劳效劳器,"&_"如实的ip为"&request.servervariables("http_x_forwarded_for")endif%>13.博得控件的一致场所//javascript<scriptlanguage="javascript">functiongetie(e){vart=e.offsettop;varl=e.offsetleft;while(e=e.offsetparent){t+=e.offsettop;l+=e.offsetleft;}alert("top="+t+"\nleft="+l);}</script>//vbscript<scriptlanguage="vbscript"><!--functiongetie()dimt,l,a,bseta=document.all.img1t=document.all.img1.offsettopl=document.all.img1.offsetleftwhilea.tagname<>"body"seta=a.offsetparentt=t+a.offsettopl=l+a.offsetleftwendmsgbox"top="&t&chr(13)&"left="&l,64,"获得控件的场所"endfunction--></script>14.光标是停在文本框笔墨的结果<scriptlanguage="javascript">functioncc(){vare=event.srcelement;varr=e.createtextrange();r.movestart('character',e.value.length);r.collapse(true);r.select();}</script><inputtype=textname=text1value="123"onfocus="cc()">15.确定上一页的根源asp:request.servervariables("http_referer")javascript:document.referrer16.最小化、最大化、封闭窗口<objectid=hh1classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><paramname="command"value="minimize"></object><objectid=hh2classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><paramname="command"value="maximize"></object><objectid=hh3classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><paramname="command"value="close"></object><inputtype=buttonvalue=最小化onclick=hh1.click()><inputtype=buttonvalue=最大化onclick=hh2.click()><inputtype=buttonvalue=封闭onclick=hh3.click()>本例实用于ie17.<%'设置数据库贯穿的少许恒量constadopenforwardonly=0'游标只向前欣赏记载,不扶助分页、recordset、bookmarkconstadopenkeyset=1'键集游标,其余用户对记载说做的窜改将反应到记载会合,但其余用户减少或简略记载不会反应到记载会合。扶助分页、recordset、bookmarkconstadopendynamic=2'动静游标功效最强,但耗费资金源也最多。用户对记载说做的窜改,减少或简略记载都将反应到记载会合。扶助全功效欣赏(access不扶助)。constadopenstatic=3'静态游标,不过数据的一个快速照相,用户对记载说做的窜改,减少或简略记载都不会反应到记载会合。扶助向前或向后挪动constadlockreadonly=1'锁定典型,默许的,只读,不许作任何窜改constadlockpessimistic=2'当编纂时登时锁定记载,最安定的办法constadlockoptimistic=3'惟有在挪用update本领时才锁定记载集,而在此前的其余操纵仍可对暂时记载举行变动、插入和简略等constadlockbatchoptimistic=4'当编纂时记载不会被锁定,而变动、插入和简略是在批处置办法下实行的constadcmdtext=&h0001constadcmdtable=&h0002%>18.网页不会被缓存htm网页<metahttp-equiv="pragma"content="no-cache"><metahttp-equiv="cache-control"content="no-cache,must-revalidate"><metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">大概<metahttp-equiv="expires"content="0">asp网页response.expires=-1response.expiresabsolute=now()-1response.cachecontrol="no-cache"php网页header("expires:mon,26jul199705:00:00gmt");header("cache-control:no-cache,must-revalidate");header("pragma:no-cache");19.查看一段字符串能否全由数字构成<scriptlanguage="javascript"><!--functionchecknum(str){returnstr.match(/\d/)==null}alert(checknum("1232142141"))alert(checknum("123214214a1"))//--></script>20.赢得一个窗口的巨细document.body.clientwidth,document.body.clientheight21.如何确定能否是字符if(/[^\x00-\xff]/g.test(s))alert("含有中国字");elsealert("全是字符");22.textarea自符合笔墨行数的几何<textarearows=1 name=s1 cols=27 onpropertychange="this.style.posheight=this.scrollheight"></textarea>23.日子减去天数即是第二个日子<scriptlanguage=javascript>functioncc(dd,dadd){//不妨加上缺点处置vara=newdate(dd)a=a.valueof()a=a-dadd*24*60*60*1000a=newdate(a)alert(a.getfullyear()+"年"+(a.getmonth()+1)+"月"+a.getdate()+"日")}cc("12/23/2002",2)</script>24.采用了哪一个radio<html><scriptlanguage="vbscript">functioncheckme()foreachobinradio1ifob.checkedthenwindow.alertob.valuenextendfunction</script><body><input name="radio1" type="radio" value="style" checked>style<input name="radio1" type="radio" value="barcode">barcode<input type="button" value="check"onclick="checkme()"></body></html>25.赢得本页url的request.servervariables("")汇合response.write"<tableborder=1><!--tableheader--><tr><td><b>variables</b></td><td><b>value</b></td></tr>"foreachobinrequest.servervariablesresponse.write"<tr><td>"&ob&"</td><td>"&request.servervariables(ob)&"</td></tr>"nextresponse.write"</table>"26.本机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 onkeydown="if(event.keycode==13)event.keycode=9">28.检验和测定某个网站的链接速率:把如次代码介入<body>地区中:<scriptlanguage=javascript>tim=1setinterval("tim++",100)b=1varautourl=newarray()autourl[1]="< src="http://www.okasp.com/techinfo/pic/url.gif" align=absmiddle border=0>www.njcatv.net"autourl[2]="javacool.3322.net"autourl[3]="< src="http://www.okasp.com/techinfo/pic/url.gif" align=absmiddle border=0>www.sina.com.cn"autourl[4]="www.nuaa.edu.cn"autourl[5]="< src="http://www.okasp.com/techinfo/pic/url.gif" align=absmiddle border=0>www.cctv.com"functionbutt(){document.write("<formname=autof>")for(vari=1;i<autourl.length;i++)document.write("<inputtype=textname=txt"+i+"size=10value=尝试中……>=》<inputtype=textname=url"+i+"size=40>=》<inputtype=buttonvalue=goonclick=window.open(this.form.url"+i+".value)><br/>")document.write("<inputtype=submitvalue=革新></form>")}butt()functionauto(url){document.forms[0]["url"+b].value=urlif(tim>200){document.forms[0]["txt"+b].value="链接超时"}else{document.forms[0]["txt"+b].value="功夫"+tim/10+"秒"}b++}functionrun(){for(vari=1;i<autourl.length;i++)document.write("<imgsrc=http://"+autourl[i]+"/"+math.random()+"width=1height=1onerror=auto('< src="http://www.okasp.com/techinfo/pic/url.gif" align=absmiddle border=0>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-resizen-resizenw-resizew-resizes-resizese-resizesw-resize1.当地无缓存,历次机动革新response.expires=0response.addheader"pragma","no-cache"response.addheader"cache-control","private"2.窜改contenttype并载入gif等方法<%functiondl(f,n)onerrorresumenextsets=createobject("adodb.stream")s.mode=3s.type=1s.opens.loadfromfile(server.mappath(f))iferr.number>0thenresponse.writeerr.number&":"&err.descriptionelseresponse.contenttype="application/x-gzip"response.addheader"content-disposition:","attachment;filename="&nresponse.binarywrite(s.read(s.size))endifendfunctioncalldl("012922501.gif","t1.gif")%>19.查看一段字符串能否全由数字构成<scriptlanguage="javascript"><!--functionchecknum(str){return!/\d/.test(str)}alert(checknum("1232142141"))alert(checknum("123214214a1"))//--></script>20.赢得一个窗口的巨细document.body.clientwidth,document.body.clientheightdocument.body.offsetwidth,document.body.offsetheight偶尔还须要领会window.screentop,window.screenleft21.如何确定能否含有中国字if(escape(str).indexof("%u")!=-1)alert("含有中国字");elsealert("全是字符");22.textarea自符合笔墨行数的几何ie5.5+不妨用overflow-y:visible<textarearows=1name=s1cols=27style="overflow-y:visible"></textarea>23.日子减去天数即是第二个日子<scriptlanguage=javascript>functioncc(dd,dadd){//不妨加上缺点处置vard=newdate(dd.replace("-","/"))d.setdate(d.getdate()+dadd)alert(d.getfullyear()+"年"+(d.getmonth()+1)+"月"+d.getdate()+"日")}cc("2002-2-28",2)</script>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.