html代码常用在博客的小技巧1. 将彻底屏蔽鼠标右键oncontextmenu="window.event.returnValue=false"
no 可用于Table 2.取消选取、防止复制 3. 不准粘贴onpaste="return false" 4.防止复制 oncopy="return false;" oncut="return false;"5.IE地址栏前换成自己的图标
6. 可以在收藏夹中显示出你的图标
7. 关闭输入法
8. 永远都会带着框架
<!--if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页// -->9. 防止被人frame
<!-- if (top.location != self.location)top.location=self.location;// -->10. 网页将不能被另存为
<iframe src="/*.html>";</iframe> 11. 查看网页源代码
12.删除时确认
删除 13. 取得控件的绝对位置//java script
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);}//VBScript
<!--function getIE()dim t,l,a,bset a=document.all.img1t=document.all.img1.offsetTopl=document.all.img1.offsetLeftwhile a.tagName<>"BODY"set a = a.offsetParentt=t+a.offsetTopl=l+a.offsetLeftwendmsgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"end function-->14. 光标是停在文本框文字的最后
function cc(){var e = event.srcElement;var r =e.createTextRange();r.moveStart("character",e.value.length);r.collapse(true);r.select();}
15. 判断上一页的来源java script:document.referrer16. 最小化、最大化、关闭窗口
本例适用于IE17.屏蔽功能键Shift,Alt,Ctrl
function look(){ if(event.shiftKey) alert("禁止按Shift键!"); //可以换成ALT CTRL} document.onkeydown=look; 18. 网页不会被缓存
或者