TA的每日心情 | 衰 2019-8-18 09:37 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
点击返回上页代码:
u2 M. j7 y3 Q2 D8 j6 c( O<form>
! G' n1 g9 e/ Y; u/ e% ~$ s, S<p><input TYPE="button" VALUE="返回上一步"></p>
# t4 {; U% t" f</form>
% |7 C5 \2 r: W) L) _9 c: I
, D; y- X, | O弹出警告框代码: ! F. X7 S. _5 B
<form>
# M& R& ?6 [0 Q' n<p><input TYPE="button" VALUE="弹出警告框"></p>
2 Z; i7 F H2 Y, m</form>
' R% T" T' Q: J. @5 {<script language="JavaScript"><!--
a7 G: O1 f K& Gfunction AlertButton(){window.alert("要多多光临呀!");}
! N' x7 y! D; M8 o// --></script> + _4 _! p: o6 _
; Z( J& V$ M A点击打开新窗口
9 Z$ V8 I% H: t) G<form> $ E& ^: F) E2 K, R6 `- d0 q
<p><input TYPE="button" VALUE="打开新窗口"></p>
$ |; k( D( Y5 e, p( x( H</form>
0 Q! P( r. w$ p1 K2 ]+ i<script language="JavaScript"><!-- o; o. s1 h" s! |0 `6 W
function NewWindow(){window.open("http://www.mcmx.com","","height=240,width=340,status=no,location=no, ( p! N) m1 R4 f
toolbar=no,directories=no,menubar=no");} & u7 T* W7 ]- c7 y6 i% g# r4 h
// --></script></body> 0 {6 |: ?; r# C' U' Y. c& M
$ M1 L7 w! n% p6 b- `
删除记录时弹出确认框: 3 B& q5 I2 A6 {- f8 B
<script LANGUAGE="VBSCRIPT">
% e, t! f7 [' q2 y( e" ga=msgbox("真的要删除该记录吗?",1,"注意") 9 j4 B" G0 t! F8 q; \2 e
if a=1 then
$ j% k/ T9 j7 ^+ s7 xlocation="Dodelete.asp?id=" //指向执行删除的页面Dodelete.asp ) r4 u V, ^6 j1 v" W. i
else
, Y5 G0 C! ^$ [$ P$ g7 m+ G9 x' z4 whistory.go(-1)
9 C6 L$ w- q% n5 d$ Tend if ! `% [& @. Q& D6 X. z* ?; |
</script> - z( [7 ^2 S- G" t/ |: ~' o D* w
$ d# C+ y/ [+ N/ I/ s; G
关闭打开的窗口 " B% l0 } N3 Q& B( v
< a href="/">关闭窗口</a>
- A! E3 g, |" r4 ?. K* R7 ?0 I& V/ o0 d" S; J
清空INPUT且选定
3 k% v% q1 j! YonClick="Javascript:this.value=''" ! c: y( L7 q2 J% {& f; R
. L2 o9 o& O+ K- O
右键屏蔽
* A( J/ P m0 ^+ m y1 J7 I<body oncontextmenu=self.event.returnValue=false>
0 O4 {9 P- P( J3 W
/ U4 t" c4 Y4 v连串英文自动换行的解决方法 IE5.5
$ M2 O! ]3 V+ E4 B& \ T1 tstyle="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word" 你可修改为指定的大小如 200px
. |. {2 t$ @4 e* W: }1 ], ]- d
图片“重置”按钮 # b) l% F1 {# ^) v, m, J" c( X
<script language="jscript"> : X5 W2 ?" e$ H; Z
function myreset() 8 [ A8 Y1 f- c$ T: p! Z
{ document.login.reset(); 8 `# [% t" w A& z- j% D
document.login.focus();} \" ~+ }/ a* k. B; s& ~6 I: D
</script>
, E' L% d+ b( u0 m$ d0 G<img src="image/reclear.gif" width="69" height="20" style="cursor:hand"
3 h: [- U& J2 Y2 ] P
" A' R3 x9 s8 h: U; i) u' y画细线表格
; X! H* _& O7 |) A9 K( }<table style="border-collapse: collapse">
- Z6 t: g. [$ _6 z. K! G" j9 T, R) U4 W1 d8 v# {6 a
状态栏信息 8 A- Z/ W7 z' l* k+ ?( `
<form> ' m& S# Y. B: D
<p><input TYPE="button" VALUE="状态栏信息"></p>
& t1 l4 I" k( p8 n/ O</form>
8 ~* q- W0 K, _+ ]<script language="JavaScript"><!--
/ O w [/ |. G/ ?4 Gfunction StatusButton(){window.status="要多多光临呀!";} a# l0 } G+ O) x; g/ |& I
// --></script>
1 b" O. \/ G9 s& u9 u0 b% U& J
- @5 Q% O2 q& p1 J最小化、最大化、关闭窗口
$ _* U& L* |5 j* O<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
2 v1 M' E3 d! W% w) j0 z' ?<param name="Command" value="Minimize"></object> 5 }) V: B( Z( K, T0 E
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> & f" J2 {# x% }. i$ E- k. J- ?
<param name="Command" value="Maximize"></object>
/ ?% U1 C( X1 Q& B ?0 E+ o( R<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
; K& J3 c: c* g D7 b+ \<PARAM NAME="Command" VALUE="Close"></OBJECT> # X5 I7 P) l' }/ L
& ?! W: R# i3 f* U( g1 `: b
<input type=button value=最小化 onclick=hh1.Click()>
2 w6 E5 y& ^% l8 h U% Z<input type=button value=最大化 onclick=hh2.Click()>
$ K8 h- c+ b/ s9 S0 Q<input type=button value=关闭 onclick=hh3.Click()> 5 u6 ]! q5 f$ H, q
本例适用于IE . C1 T- w( N+ s. J% T3 j4 J, d0 y. Q
/ b J) N# c+ N% A
隐藏状态栏里出现的LINK信息
/ {9 U, V4 ?, r4 o<a href="http://";>梦想天空</a>
; O6 e& Q) u+ b$ N7 c; P! w4 Z; Q, D, ]7 h0 Y
文本框自动滚动条
T- m3 T7 ?4 K- ]8 k<textarea name=words rows=18 cols=26 style="border:1 solid #000000;background-color:white; font-size:9pt; width:188; overflow:auto" wrap=hard></textarea> $ A k0 w9 e/ [( o
0 a, K; h D1 I! P: |9 m7 J* B全选并复制 0 R4 ^2 @& k. z L5 s' T j/ T
<FORM name=test><INPUT type=button value=全选并复制><BR><TEXTAREA name=select1 rows=3 cols=46>你好,欢迎您的光临!</TEXTAREA>
% j. o& A- B: X% J' H5 Q</FORM> ) c5 ?* a9 |4 w, l2 D [. j7 t* n
<SCRIPT language=Javascript> 2 k8 _ \7 p# ^
<!-- $ C7 {. Z: A- t+ g8 [9 p, D2 F/ ~
0 y7 \& P* g- A( Dvar copytoclip=1
7 T" f! L; M1 h' I$ z
- y: N$ ~0 j9 k' @. B! Cfunction HighlightAll(theField) { 5 S# Z% P5 ~" d$ I7 ?4 k
var tempval=eval("document."+theField) 8 O5 e( I* h2 F. i" h& i8 s, {! T9 t
tempval.focus() ) T/ s1 q8 A& r+ [& M: G5 {7 K
tempval.select()
7 K, x0 \: _+ K! m2 S3 D7 {if (document.all&©toclip==1){
7 ~- x% }; F0 ~ y- T2 l4 r. Ctherange=tempval.createTextRange() 1 g6 c& \# r6 A" o* w% x
therange.execCommand("Copy")
# j6 _3 V0 x0 B' V( d4 `6 lwindow.status="Contents highlighted and copied to clipboard!" ( {; @7 J9 N" A, b' K( P# a3 N/ t& P
setTimeout("window.status=''",1800)
9 v9 G; u! h6 Q8 ?+ j} 7 I) l$ J& M1 m; {- |, ~9 S# }. B- W
} ' X: }6 o9 y' H& ?0 o+ x
//--> & \- k3 j: w6 L+ S
</SCRIPT> 4 m% Q' b3 X) l/ v5 f
v" f: q5 O6 E5 q% l- k屏蔽JAVASCRIPT错误
7 L1 i( _) `* u) A/ `<script language="JavaScript"> : [# u2 r- Y5 X5 C
<!--
9 I$ D/ z7 z' I( u2 m( K) `0 kfunction killErrors(){ 5 a5 Z0 {4 F" g0 Y) K
return true; 4 T7 ^1 p5 K! d+ h u) H1 x
}
/ K4 k+ n1 Y! o6 W1 C. o! I7 D. Kwindow.onerror = killErrors;
s2 I$ ?9 @' f) l. d9 ^--> 3 N& O2 b$ D$ G$ o2 \4 _
</script>
/ W' H- V/ @! [! b9 G0 L; p, R* F* V) K
关闭子窗口时刷新父窗口
+ e# H1 S" @; S5 n<script language="JavaScript"> 4 B. [" b! O+ `% p; Q. \
<!--
& n7 h, L, b) p# a4 j+ Pself.opener.location.reload(); - j/ Y. N4 e$ d' c+ }: l: \
window.close() 2 i: v) F' t! J4 d
--> o5 j$ W) U b) q6 e( B' K0 z1 n$ Y
</script>
2 i& S8 E+ N9 y6 t. l% A
- t! E) B( k% b5 K( f: D6 X1 E9 \! E
背景色变换
% M1 q3 }! `0 c& k. |& m<form> ; @' c, [1 j @1 K l Y7 F3 a- M0 v
<p><input TYPE="button" VALUE="背景色变换"></p> 9 _3 x$ Z; |# C0 l$ K F6 K; g
</form>
, s* v' g- R8 j. Y! ?, S- @<script>function BgButton(){ + W& G1 r& }! c$ {% l9 F( q
if (document.bgColor=='#00ffff') 2 g, M9 p3 |% I! U) K4 j [" k( M1 k
{document.bgColor='#ffffff';}
m: s G# D$ Z. qelse{document.bgColor='#00ffff';}
/ [6 ~" {% \3 \" [}
' E, d; i& C& J" A: g</script> 4 c- }, c' K0 ^5 _0 P
; K7 c7 G8 b; z* j1 U
检查一段字符串是否全由数字组成 . t4 D6 b' G! ^
<script language="Javascript"><!-- 1 H- F2 y% d' ~/ I" _! d
function checkNum(str){return str.match(//D/)==null} 2 D, a: C* h' D% p5 ~4 u
alert(checkNum("1232142141")) 1 q" F: i$ t- G9 y+ ?. r- Z
alert(checkNum("123214214a1"))
' g" [, C8 s4 ?# e9 M// --></script>
* J, q1 a4 x% P% g. y0 N2 {
* O0 o. v8 N" k4 f% x6 k判断是否是字符 - \: a$ ]9 F4 E+ I0 x
if (/[^/x00-/xff]/g.test(s)) alert("含有汉字"); + }$ M3 V' F( {% i8 N
5 u( V% A$ w9 c' p9 o, ]2 d
点击刷新代码:
. M; w2 ~' t0 i: H) _<form>
. `) j/ E, k8 i2 Q% l7 R4 C. y<p><input TYPE="button" VALUE="刷新按钮一"></p> ! c, d$ I7 O, K X `
</form> * ?( s- b% e h; Z
<script language="JavaScript"><!--
" @' k/ X( @2 n' V+ z2 ]* \9 bfunction ReloadButton(){location.href="allbutton.htm";} 7 b' [5 ^% ?# n; u+ H6 C7 I2 e
// --></script>
4 t, ~& { y- K/ G# G
0 Z4 A" ]: ~; r4 P, x! M让层不被控件复盖代码:
: ~: m0 W7 Q8 A& D' \0 w/ i( ^<div z-Index:2><object xxx></object></div> # 前面 $ C. ~! z! F/ |4 N0 Z1 d- Q
<div z-Index:1><object xxx></object></div> # 后面 + r* G1 E! K6 J2 x
<div id="Layer2" style="position:absolute; top:40;width:400px; height:95px;z-index:2"><table height=100% width=100% bgcolor="#ff0000"><tr><td height=100% width=100%></td></tr></table><iframe width=0 height=0></iframe></div>
! ?! L# S7 Q3 C, ]( F' A2 ^<div id="Layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div> ( N- |# o9 ^) s8 U6 \
) a* d, ?8 D$ `8 n. T
让层的相对定位 8 t. U3 C. q+ [+ V) v
<div id="Layer1" style="position:relative; left:0px; top:0px; width:0px; height:0px;z-index:1"> ' u T) T z' J
<div id="Layer2" style="position:absolute; left:500px; top:0px; width:220px; height:220px; z-index:1"> - w! C( W; b# A/ e8 V
内容 4 [8 c2 s, H; H# Y" i
</div></div> 2 {( P C% I6 }& O. p
2 z( s, o0 B) V V7 a- |Flash代码以及背景透明
6 g; |2 B0 ~# R- u* A, p+ L<object classid="clsid 27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="200"> & U( F$ L$ @# h4 Q
<param name="movie" value="文件">
5 a( e4 B- p, P: m4 _1 s1 c }<param name="quality" value="high"> + g L+ c0 ^ I, X
<param name="wmode" value="transparent">
( r* ?; V8 t3 [8 T+ Y<embed src="images/fish.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="220" height="220"></embed></object> |
|