Web Design Skills in (on)

1. oncontextmenu = "window.event.returnValue = false" will completely shield Right
<table border oncontextmenu = return (false )> <td> no </ table> Table may be used

2. <body onselectstart = "return false"> deselect, copy protection

3. onpaste = "return false" allowed Paste

4. oncopy = "return false;" oncut = "return false;" copy protected

5. <link rel = "Shortcut Icon" href = "favicon.ico"> IE address bar into the front own icon

6. <link rel = "Bookmark" href = "favicon.ico"> you can show an icon in the Favorites

7. <input style = "ime-mode: disabled"> Close input

8. The frame will always take
<Script Language = "the JavaScript"> <-!
IF (window == Top) top.location.href = "frames.htm"; //frames.htm framework page
// - > </ script>

9. 防止被人frame
<SCRIPT LANGUAGE=JAVASCRIPT><!--
if (top.location != self.location)top.location=self.location;
// --></SCRIPT>

10. The page will not be saved as
<noscript> <iframe src = " / blog / * html.>"; </ Iframe> </ noscript>

11. <input type = button value = See page source code
the onclick = "the window.location =" View-Source: "+" http://www.williamlong.info "">

12. Confirm delete
<a href="javascript:if(confirm("确实要删除吗?"))location="boos.asp?&areyou=删除&page=1""> delete </a>

13. The absolute position acquired control
// Javascript
<Script Language = "Javascript">
function getIE (E) {
var T = e.offsetTop;
var L = e.offsetLeft;
the while (E = e.offsetParent)
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>

14. The cursor is stopped at the last word text box
<Script Language = "JavaScript">
function CC ()
{
var E = event.srcElement;
var = R & lt e.createTextRange ();
r.moveStart ( "Character", E. value.length);
r.collapse (to true);
R.SELECT ();
}
</ Script>
<INPUT type = text name = text1 value = "123" the onfocus = "CC ()">

15. 判断上一页的来源
javascript:
document.referrer
16. 最小化、最大化、关闭窗口
<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()>
This example is for IE

17. The shielding function keys Shift, the Alt, the Ctrl
<Script>
function look () {
IF (event.shiftKey)
Alert ( "Shift-prohibited!"); // the CTRL can be replaced with the ALT
}
document.onkeydown = look;
< / script>

18. 网页不会被缓存
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
或者<META HTTP-EQUIV="expires" CONTENT="0">

19. How to make the form is no concavity?
<input type = text style = " border: 1 solid # 000000">
or
<input type = text style = " border-left: none; border-right: none; border-top: none; border-bottom:

1 solid #000000"></textarea>

20. <div> <span> & <layer> difference?
<div> (division) is used to define a large section of the page elements, will have to switch to
<span> to define the elements within the same line, with <div> The only difference is that no switch to
<layer> tag is ns, ie do not support, equivalent to <div>

Reproduced in: https: //www.cnblogs.com/majinyu/archive/2007/04/02/696556.html

Guess you like

Origin blog.csdn.net/weixin_34008933/article/details/93666462