ASP.NET中常用的js代码讲解
|
源代码网整理以下3、在button的onClick事件中输入 源代码网整理以下this.RegisterClientScriptBlock("e","<scriptlanguage=javascript>history.go(-2);</script>"); 源代码网整理以下 源代码网整理以下三、弹出框 源代码网整理以下1、 弹出提示框 软件开发网 www.mscto.com
源代码网整理以下Alert("提示框,呵呵"); 源代码网整理以下2、 弹出确认框 源代码网整理以下return confirm("确认框,呵呵"); 源代码网整理以下四、其它常用JS 源代码网整理以下1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键 源代码网整理以下<table border oncontextmenu=return(false)><td>no</table> 可用于Table 源代码网整理以下2. <body onselectstart="return false"> 取消选取、防止复制 源代码网整理以下3. onpaste="return false" 不准粘贴 源代码网整理以下4. oncopy="return false;" oncut="return false;" 防止复制 源代码网整理以下5. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自己的图标 源代码网整理以下6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标 软件开发网 www.mscto.com
源代码网整理以下7. <input style="ime-mode:disabled"> 关闭输入法 源代码网整理以下8. 永远都会带着框架 <script language="JavaScript"><!-- if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页 // --></script> 源代码网整理以下9. 防止被人frame <SCRIPT LANGUAGE=JAVASCRIPT><!-- if (top.location != self.location)top.location=self.location; // --></SCRIPT> 源代码网整理以下10. <noscript><iframe src=*.html></iframe></noscript> 网页将不能被另存为 源代码网整理以下11. <input type=button value=查看网页源代码 onclick="window.location = "view-source:"+ "http://www.csdn.net/""> 源代码网整理以下12. 怎样通过asp的手段来检查来访者是否用了代理 源代码网整理以下<% if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" then 源代码网整理以下response.write "<font color=#FF0000>您通过了代理服务器,"& _ "真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR") end if %> 源代码网整理以下13. 取得控件的绝对位置 源代码网整理以下//Javascript 源代码网整理以下<script language="Javascript"> 源代码网整理以下function getIE(e) 源代码网整理以下{ var t=e.offsetTop; 源代码网整理以下var l=e.offsetLeft; 源代码网整理以下while(e=e.offsetParent) 源代码网整理以下{ t+=e.offsetTop; 源代码网整理以下l+=e.offsetLeft; 源代码网整理以下} 源代码网整理以下alert("top="+t+" left="+l); 源代码网整理以下} 源代码网整理以下</script> 源代码网整理以下//VBScript 源代码网整理以下<script language="VBScript"> 软件开发网 www.mscto.com 源代码网整理以下<!-- function getIE() 源代码网整理以下dim t,l,a,b 源代码网整理以下set a=document.all.img1 源代码网整理以下t=document.all.img1.offsetTop 源代码网整理以下l=document.all.img1.offsetLeft 源代码网整理以下while a.tagName<>"BODY" 源代码网整理以下set 源代码网整理以下a = a.offsetParent 源代码网整理以下t=t+a.offsetTop 软件开发网 www.mscto.com 源代码网整理以下l=l+a.offsetLeft 源代码网整理以下wend 源代码网整理以下msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置" 源代码网整理以下end function --> 源代码网整理以下</script> 源代码网整理以下14. 光标是停在文本框文字的最后 源代码网整理以下<script language="javascript"> 源代码网整理以下function cc() 源代码网整理以下{ var e = event.srcElement; 源代码网整理以下var r =e.createTextRange(); 源代码网整理以下r.moveStart("character",e.value.length); 源代码网整理以下r.collapse(true); 源代码网整理以下r.select(); } 源代码网整理以下</script> <input type=text name=text1 value="123" onfocus="cc()"> 软件开发网 www.mscto.com 源代码网整理以下15. 判断上一页的来源 源代码网整理以下asp: request.servervariables("HTTP_REFERER") 源代码网整理以下java script: document.referrer 软件开发网 www.mscto.com 源代码网整理以下16. 最小化、最大化、关闭窗口 软件开发网 www.mscto.com
源代码网整理以下<object id=hh1 软件开发网 www.mscto.com
源代码网整理以下classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> 源代码网整理以下<param name="Command" value="Minimize"> 源代码网整理以下</object> 源代码网整理以下<object 源代码网整理以下id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> 源代码网整理以下<param name="Command" value="Maximize"></object> 源代码网整理以下<OBJECT id=hh3 源代码网整理以下classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> 源代码网整理以下<PARAM NAME="Command" VALUE="Close"></OBJECT> 源代码网整理以下<input type=button value=最小化 onclick=hh1.Click()> 源代码网整理以下<input type=button value=最大化 onclick=hh2.Click()><input type=button value=关闭 onclick=hh3.Click()> 软件开发网 www.mscto.com 源代码网推荐 源代码网供稿. |
