来源:www.cncfan.com | 2006-8-9 | (有2073人读过)
ie地址栏前换成自己的图标
<link rel="shortcut icon" href="/lingcomnet/favicon.ico">
可以在收藏夹中显示出你的图标
<link rel="bookmark" href="/lingcomnet/favicon.ico">
关闭输入法
<input style="ime-mode:disabled">
永远都会带着框架
<script language="javascript"><!-- if (window == top)top.location.href = "frames.htm"; /frames.htm为框架网页 / --> </script>
防止被人frame
<script language=javascript><!-- if (top.location != self.location) top.location=self.location; / --> </script>
怎样通过asp的手段来检查来访者是否用了代理
<% if request.servervariables("http_x_forwarded_for")<>"" then response.write "<font color=#ff0000>您通过了代理服务器," ! "真实的ip为 "!request.servervariables("http_x_forwarded_for") end if %>
取得控件的绝对位置
/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+"nleft="+l); } </script>
/vbscript <script language="vbscript"> <!-- 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 l=l+a.offsetleft wend msgbox "top="!t!chr(13)!"left="!l,64,"得到控件的位置" end function --> </script>
光标是停在文本框文字的最后
<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()">
判断上一页的来源
asp: request.servervariables("http_referer")
javascript: document.referrer
最小化、最大化、关闭窗口
<object id=hh1 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()> 本例适用于ie
记录并显示网页的最后修改时间
<script language=javascript> document.write("最后更新时间: " + document.lastmodified + "") </script>
2秒后关闭当前页
<script language="javascript"> <!-- settimeout(’window.close();’,2000); --> </script>
2秒后载入指定网页
<head> <meta http-equiv="refresh" content="2;url=http://你的网址"> </head>
添加到收藏夹
<script language="javascript"> function bookmarkit() { window.external.addfavorite(’http://你的网址’,’你的网站名称’) } if (document.all)document.write(’<a href="/lingcomnet/#" onclick="bookmarkit()">加入收藏夹</a>’) </script>
|