Essence ASP code collection

xiaoxiao2021-03-06  23

The following is program code:

1.

οncοntextMenu = "Window.Event.ReturnValue = false"

Rightly shield the mouse button

Border

οncοntextMenu = return (false)> NO

Can be used for table

2.

OnseTartStart = "Return

False>

Cancel to select

3.

οnpaste = "Return

False

Not stick to paste

4.

οncοpy = "Return

False; "

ONCUT = "Return

False; "

Prevent copy

5.

Rel = "shortcut

Icon

HREF = "favicon.ico">

IE addressed to your own icon before IE address column

6.

Rel = "Bookmark"

HREF = "favicon.ico">

You can display your icon in your favorites.

7.

Style = "IME-MODE: DISABED">

Close input method

8.

Always bring a framework

Language = "javascript">

IF

(Window

==

Top.Location.href

=

"frames.htm";

//frames.htm is a frame web page

//

->

9.

Prevent people from being frame

Language = javascript>

IF

(Top.Location

! =

Self.location) Top.Location = Self.location;

//

->

10.

SRC = *. HTML>

The web page will not be saved as

11.

Type = button

Value = View web page source code

οnclick = "Window.Location

=

'View-Source:'

'http://www.9cbs.net/' ">

12.

How to check if the visitors use the agent through the means of ASP

<%

IF

Request.ServerVariables ("http_x_forwarded_for") <> ""

THEN

Response.write

"

Color = # ff0000> You pass the proxy server, "&

_

"Real IP" & Request.SerVariables ("http_x_forwarded_for")

end

IF

%>

13.

Get absolute position of the control

// javascript

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);

}

// vbscript

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 the location of the control"

end

FUNCTION

->

14.

The cursor is the last stop in the text box text

Language = "javascript">

FUNCTION

CC ()

{

VAR

e

=

Event.srcelement;

VAR

r

= E.CREATEXTRANGE ();

R.MoveStart ('Character', E.Value.Length);

R.Collapse (True);

R.select ();

}

TYPE = TEXT

Name = text1

Value = "123"

οnfοcus = "cc ()">

15.

Judging the source of the previous page

ASP:

Request.ServerVariables ("http_referer")

JavaScript:

Document.referrer

16.

Minimize, maximize, close windows

ID = HH1

ClassID = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11">

Name = "command"

Value = "minimize">

ID = HH2

ClassID = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11">

Name = "command"

Value = "maximize">

ID = HH3

ClassID = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11">

Name = "command"

Value = "close">

Type = button

Value = Minimize

οnclick = hh1.click ()>

Type = button

Value = Maximize

οnclick = hh2.click ()>

Type = button

Value = close

οnclick = hh3.click ()>

This example is suitable for IE

转载请注明原文地址:https://www.9cbs.com/read-56869.html

New Post(0)