1. oncontextmenu= "Window.event.returnvalue=false" will be Beecher
Bottom Screen right mouse button
<table border Oncontextmenu=return (false) ><td>no</table>
Available for table
2. <body onselectstart= "return false" > cancel
Select, prevent replication
3. onpaste= "return False"
No pasting.
4. oncopy= ' return false; ' oncut= ' return false;
Prevent replication
5. <link rel= "shortcut Icon" href= "Favicon.ico" > IE Address bar before
Switch to your own icon
6. <link rel= "Bookmark" href= "Favicon.ico" > can be in the Favorites folder
Show you the icon
7. <input style= "ime-mode:disabled" >
Close IME
8. Always with the frame
<script language= "JavaScript" ><!--
if (window = top) Top.location.href = "frames.htm";
Frames.htm for frames page
--></script>
9. Prevent a person from being frame
<script language=javascript><!--
if (top.location!=
self.location) top.location=self.location;
--></script>
<noscript><iframe src=*.html></iframe></noscript> Network
Page will not be saved as
<input type=button value= View Web page source code
onclick= "window.location = ' View-source: ' +
' http://www.csdn.net/' >
12. How to use the ASP means to check whether the visitor used the agent
<% if Request.ServerVariables ("Http_x_forwarded_for") <> ""
Then
Response.Write "<font color= #FF0000 > You have passed the proxy server," &
_
"True IP is
"&request.servervariables (" Http_x_forwarded_for ")
End If
%>
13. Get the absolute position of the control
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 & "left=" &l,64, "get position of control"
End Function
--></script>
14. Cursor is stopped at the end of text box text
<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 ()" >
15. Determining the origin of the previous page
Asp:
Request.ServerVariables ("Http_referer")
Javascript:
Document.referrer
16. Minimize, maximize, close windows
<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= Minimize onclick=hh1. Click () >
<input Type=button value= maximize ONCLICK=HH2. Click () >
<input Type=button value= closes Onclick=hh3. Click () >
This example applies to IE
17.
<%
' Define some constants for database connections
Const adopenforwardonly = 0 ' cursor only browses the record forward, not supported
Pagination, Recordset, BookMark
Const adOpenKeyset = 1 ' keyset cursor, the other user says to the record
Changes will be reflected in the recordset, but other users adding or deleting records will not be reflected in the
Records set. Support paging, Recordset, BookMark
Const adopendynamic = 2 ' Dynamic cursors are the most powerful, but cost-source
and most. User changes to the record said, add or delete records will be reflected to the recordset
In Supports full feature browsing (not supported by Access).
Const adopenstatic = 3 ' static cursor, just a quick data
According to, the user changes to the record said, add or delete records are not reflected in the recordset
。 Supports moving forward or backward
Const adlockreadonly = 1 ' lock type, default, read-only, no
can make any changes
Const Adlockpe