<p>1. οncοntextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键<br><table border οncοntextmenu=return(false)><td>no</table> 可用于Table</p>
<p>2. <body onselectstart="return false"> 取消选取、防止复制</p>
<p>3. οnpaste="return false" 不准粘贴</p>
<p>4. οncοpy="return false;" oncut="return false;" 防止复制</p>
<p>5. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自己的图标</p>
<p>6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标</p>
<p> <br>7. <input style="ime-mode:disabled"> 关闭输入法</p>
<p><br>8. 永远都会带着框架<br><script language="JavaScript"><!--<br>if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页<br>// --></script></p>
<p><br>9. 防止被人frame<br><SCRIPT LANGUAGE=JAVASCRIPT><!-- <br>if (top.location != self.location)top.location=self.location;<br>// --></SCRIPT></p>
<p><br>10. 网页将不能被另存为<br><noscript><*** src="/*.html>";</***></noscript> </p>
<p><br>11. <input type=button value="/查看网页源代码 <br>οnclick="window.location = "view-source:"+ "<a href="http://www.pconline.com.cn">http://www.pconline.com.cn</a>""><br>12.删除时确认<br><a href=""javascript :if(confirm("确实要删除吗?"))location="boos.asp?&areyou=删除&page=1"">删除</a> </p>
<p><br>13. 取得控件的绝对位置<br>//Javascript<br><script language="Javascript"><br>function getIE(e){<!-- --><br>var t=e.offsetTop;<br>var l=e.offsetLeft;<br>while(e=e.offsetParent){<!-- --><br>t+=e.offsetTop;<br>l+=e.offsetLeft;<br>}<br>alert("top="+t+"/nleft="+l);<br>}<br></script><br>//VBScript<br><script language="VBScript"><!--<br>function getIE()<br>dim t,l,a,b<br>set a=document.all.img1<br>t=document.all.img1.offsetTop<br>l=document.all.img1.offsetLeft<br>while a.tagName<>"BODY"<br>set a = a.offsetParent<br>t=t+a.offsetTop<br>l=l+a.offsetLeft<br>wend<br>msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"<br>end function<br>--></script></p>
<p><br>14. 光标是停在文本框文字的最后<br><script language="javascript"><br>function cc()<br>{<!-- --><br>var e = event.srcElement;<br>var r =e.createTextRange();<br>r.moveStart("character",e.value.length);<br>r.collapse(true);<br>r.select();<br>}<br></script><br><input type=text name=text1 value="123" οnfοcus="cc()"></p>
<p><br>15. 判断上一页的来源<br>javascript :<br>document.referrer</p>
<p><br>16. 最小化、最大化、关闭窗口<br><object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <br><param name="Command" value="Minimize"></object><br><object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <br><param name="Command" value="Maximize"></object><br><OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><br><PARAM NAME="Command" value="/Close"></OBJECT><br><input type=button value="/最小化 οnclick=hh1.Click()><br><input type=button value="/blog/最大化 οnclick=hh2.Click()><br><input type=button value=关闭 οnclick=hh3.Click()><br>本例适用于IE</p>
<p><br>17.屏蔽功能键Shift,Alt,Ctrl<br><script><br>function look(){ <br>if(event.shiftKey) <br>alert("禁止按Shift键!"); //可以换成ALT CTRL<br>} <br>document.οnkeydοwn=look; <br></script></p>
<p><br>18. 网页不会被缓存<br><META HTTP-EQUIV="pragma" CONTENT="no-cache"><br><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"><br><META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"><br>或者<META HTTP-EQUIV="expires" CONTENT="0"></p>
<p><br>19.怎样让表单没有凹凸感?<br><input type=text style="""border:1 solid #000000"> <br>或<br><input type=text style="border-left:none; border-right:none; border-top:none; border-bottom: <br>1 solid #000000"></textarea></p>
<p><br>20.<div><span>&<layer>的区别? <br><div>(division)用来定义大段的页面元素,会产生转行 <br><span>用来定义同一行内的元素,跟<div>的唯一区别是不产生转行 <br><layer>是ns的标记,ie不支持,相当于<div></p>
<p><br>21.让弹出窗口总是在最上面:<br><body οnblur="this.focus();"></p>
<p><br>22.不要滚动条? <br>让竖条没有: <br><body style="o |
|