ASP excellent questions and answers (2) (1)

Source: Internet
Author: User

1. oncontextmenu = "window. event. returnvalue = false" will completely block the right mouse button
<Table border oncontextmenu = return (false)> <td> no </table>
2. <body onselectstart = "return false"> cancel selection to prevent Replication
3. onpaste = "return false" Do not paste
4. oncopy = "return false;" oncut = "return false;" Prevent Replication
5. <link rel = "Shortcut Icon" href = "favicon. ico"> replace it with your own Icon in front of the IE Address Bar
6. <link rel = "Bookmark" href = "favicon. ico"> your Icons can be displayed in favorites.
7. <input style = "ime-modeisabled"> disable the input Method
8. Always carry the framework
<Script language = "javascript"> <! --
If (window = top) top. location. href = "frames.htm"; // frames.htm is the frame webpage.
// --> </Script>
9. Prevent frame
<Script language = javascript> <! --
If (top. location! = Self. location) top. location = self. location;
// --> </SCRIPT>
10. <noscript> <iframe src = *. html> </iframe> </noscript> webpages cannot be saved
11. <input type = button value = view webpage source code
Onclick = "window. location = 'view-source: '+ 'HTTP: // www.csdn.net/'";>
12. How to use asp to check whether the visitor has used an agent?
<% If Request. ServerVariables ("HTTP_X_FORWARDED_FOR") <> "then
Response. write "<font color = # FF0000> you have passed the proxy server ,"&_
"The real IP address is" & Request. ServerVariables ("HTTP_X_FORWARDED_FOR ")
End if
%>
13. Obtain 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 +"
Left = "+ 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, "Get control position"
End function
--> </Script>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.