TA的每日心情 | 衰 2019-8-18 09:37 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
点击返回上页代码: " q' K0 l$ q1 ^: H* B" a
<form> * D3 F5 z( T" i I2 G- a
<p><input TYPE="button" VALUE="返回上一步"></p>
, b" t3 }! v _- u</form>
% G: L Y- G+ D3 k# N; F. w7 A3 l' t6 m
弹出警告框代码:
) W x8 R1 y+ H' K' @' v; t<form> ' B) `5 c5 ~% I
<p><input TYPE="button" VALUE="弹出警告框"></p>
/ Y( d- I. e1 h# T</form> $ C# o5 i0 m) A" Q* |3 N( }
<script language="JavaScript"><!--
8 o1 T* m4 B! C5 I6 G) bfunction AlertButton(){window.alert("要多多光临呀!");} & P, b m$ i8 d) S, M" O. t
// --></script> ) ]$ I7 n$ R" i6 p, f" @
+ f. S9 J0 y( U, H% \6 M点击打开新窗口 4 B8 {% ^, J) X7 [) X
<form>
! M) L$ z' Q7 b, J9 j<p><input TYPE="button" VALUE="打开新窗口"></p> 4 L; W+ T0 `4 j5 [2 X. r9 V
</form>
. V9 b4 B- q" M. v1 ?' Z0 H<script language="JavaScript"><!-- & L$ O# l5 r5 {1 u
function NewWindow(){window.open("http://www.mcmx.com","","height=240,width=340,status=no,location=no,
9 r7 \4 U8 i/ @' V& `/ ~toolbar=no,directories=no,menubar=no");}
' K; K5 u( s; ^( |: G! ~ u// --></script></body> : ~4 s; I! N0 P$ D6 \/ A
6 ]! b3 v" r5 w+ o5 H删除记录时弹出确认框: D- g$ b4 H. n. v( |6 G
<script LANGUAGE="VBSCRIPT"> / |5 T. C' m M [4 |
a=msgbox("真的要删除该记录吗?",1,"注意") $ C4 H$ u V' Y/ {, X5 m
if a=1 then
& l) A$ K+ n! c( x( N, d0 t/ l$ ]location="Dodelete.asp?id=" //指向执行删除的页面Dodelete.asp
8 f2 {+ B+ L# j" o9 o1 `% e; Belse % J- X P2 i& M4 }" k3 `# G
history.go(-1) ) m% ?& T, W$ w9 K$ T# q( P( j) W! C
end if
9 ~$ S5 |* _. N1 {: m0 y2 H</script> , L* Z9 o! J2 ]( ?. o
: b7 z, U( I$ c% A* a- m# E& H5 q
关闭打开的窗口 " j1 k- X+ d( y2 w7 i$ Y7 I
< a href="/">关闭窗口</a>
" x7 G/ ]& Z7 n0 j/ p+ S
! B( R* A/ k; Q( h3 r清空INPUT且选定
/ \2 ^5 v8 F5 I i$ H# ^* VonClick="Javascript:this.value=''"
1 e3 v! {+ v* ~, D. G. _' k% N$ {( Y; E( U
右键屏蔽
: i. {3 G& ~9 ]6 Y& ?<body oncontextmenu=self.event.returnValue=false> ; K% q( L) [- X7 B' A
# k7 |+ [: R1 _" g, G2 k0 Q, A连串英文自动换行的解决方法 IE5.5
5 p4 w6 ?4 t- Gstyle="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word" 你可修改为指定的大小如 200px ! a* A& b) E) B$ B
3 T5 u. v+ `& ~
图片“重置”按钮
" ~5 d; e7 ?: e( D0 q<script language="jscript"> - H, T$ d3 I- F" _
function myreset() 1 R$ ~) C9 D# |; |, m; e
{ document.login.reset(); $ _( c" ^- }2 V: Z, F' J- o1 e' }
document.login.focus();} ) U. y9 |+ P& R1 m$ W6 O6 @" p1 w
</script> # H9 ]1 H: z" y: ?
<img src="image/reclear.gif" width="69" height="20" style="cursor:hand" ' g: C' Q0 u4 x& s
3 F! _" }3 x5 f, o, N) H7 p% g画细线表格
8 n6 T5 ? Z" ?3 A( A; C<table style="border-collapse: collapse"> $ W$ k7 L0 D' |& u+ W& @$ |
& o! |/ k! U1 \! w) N状态栏信息
. R% z) i: V+ x4 O* q" ?0 I<form>
! h9 T8 w8 _. v% j% s5 k- h<p><input TYPE="button" VALUE="状态栏信息"></p> " I0 J$ M" ?! L5 y @- x
</form> 8 F# W7 s* U$ a- }# w. g" v! m
<script language="JavaScript"><!-- % I" c9 _3 k; G7 T3 b" V
function StatusButton(){window.status="要多多光临呀!";}
x" w( }% Q5 ^; h. Y! t* E3 j// --></script> . T! ?+ {" ]3 f. R6 h- N
' a' X+ L: a. f- L
最小化、最大化、关闭窗口
: e; X6 W7 k6 d<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> - r- @ x0 y9 P* d# V
<param name="Command" value="Minimize"></object> 1 P* x6 [' x2 ~6 u# D
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> # k/ }6 e! Q* A5 \% h6 _
<param name="Command" value="Maximize"></object>
& a) F3 H+ E& X+ E/ P! k2 f<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> 1 _( r1 D/ O* E4 |1 ^
<PARAM NAME="Command" VALUE="Close"></OBJECT> 9 h! b7 b) R0 }
& Z: O/ o k$ B* Q8 [
<input type=button value=最小化 onclick=hh1.Click()>
3 C! j, _" Y( _( V<input type=button value=最大化 onclick=hh2.Click()> # N: i- _5 L+ }# d; ?3 ]1 u) v
<input type=button value=关闭 onclick=hh3.Click()>
4 [% e' F1 m+ b+ @. w: c本例适用于IE ' S; u1 T& u }% R
7 w; ~7 ~. |3 y# B3 E( f! h
隐藏状态栏里出现的LINK信息
# }3 Y- V1 l' _# }4 w1 s<a href="http://";>梦想天空</a>
/ B5 \! Q) Q+ J# I( a$ g
6 L) b3 h3 _. H, r$ X文本框自动滚动条
4 r* ?: N, j' I) R7 G" M) i<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>
R" P7 T j" ?, {" i) s+ ]. }& q8 ?4 H) e: A
全选并复制 ( M- S/ `- C( C5 [5 {0 I
<FORM name=test><INPUT type=button value=全选并复制><BR><TEXTAREA name=select1 rows=3 cols=46>你好,欢迎您的光临!</TEXTAREA>
4 V' |8 @# w1 h2 W7 h$ y</FORM> # j; J, V4 \9 F* `: s) |( I6 d
<SCRIPT language=Javascript>
, P' P- @3 r5 F5 }" ^, E" Y7 B; `<!--
% Z# B- N/ l; U* X% k4 R8 \" ]& i* K+ l4 d5 l
var copytoclip=1
/ D# \9 `- q2 r4 w, c& Z" A4 f6 _7 _6 N6 p' l3 O$ J! h7 T; j; ^
function HighlightAll(theField) { 5 R) }2 z: W1 m! o3 }: n
var tempval=eval("document."+theField) " t6 [8 o: k. S7 X: n: p! o2 _3 x
tempval.focus() 2 N" B# S8 I" c- ?& `) }
tempval.select() 3 [1 q) c/ h+ b$ a/ Y( a# O* O6 j3 g1 Y
if (document.all&©toclip==1){ ' t( d" H2 E$ [0 B
therange=tempval.createTextRange()
1 Q; \# v$ F# u3 j& Ctherange.execCommand("Copy") ; s+ A% E8 t2 ~5 N3 E a- s
window.status="Contents highlighted and copied to clipboard!" ) |; E& |1 n1 z+ p R2 F4 J
setTimeout("window.status=''",1800)
3 ~. T$ m% V! s8 }}
! Q9 b4 X @% b} P# N- p$ V& h' M: i+ W
//--> / {* g2 \3 W) O- z7 X5 A
</SCRIPT> + I0 n# u) J/ I. S$ I7 N+ S3 t+ a
, \& p2 o( p# B- x屏蔽JAVASCRIPT错误 + |9 r+ a' W( O. y4 z
<script language="JavaScript"> , A. Q$ ~1 W/ A( L0 r! E
<!-- 6 {' j- m# C' N
function killErrors(){ ]7 E. ~* I) x" O
return true;
4 A/ |- _& @$ g}
2 j8 h7 Y2 z& y2 @+ jwindow.onerror = killErrors; 7 n1 S/ a% u1 ^
--> 9 c+ G& R: A1 q; n
</script>
: V- C: W1 z4 y- e+ Y, B: q9 R' _5 {! _: a$ m: @% N: D4 j9 P4 y: l! z$ G
关闭子窗口时刷新父窗口
4 { ^ s9 t5 q<script language="JavaScript">
' Z# t- L# B @0 \, [% T<!--
1 _" j. V+ _0 b# @self.opener.location.reload();
9 Y1 E" C [: }0 w& }% Iwindow.close()
2 ?2 M* s, I& b--> 2 N/ O* C5 D" Q" R; p. Z$ h
</script>
$ I9 q0 V N' O9 ^1 R* C" l5 _2 a5 U6 s0 k. q% h. m& [
- N$ L1 x& U$ ^& [, n
背景色变换 8 {# N4 `, @5 B2 V- D' U% W
<form> % C3 O) X" W9 [8 W/ }
<p><input TYPE="button" VALUE="背景色变换"></p> 0 l, e. G: a6 k5 E
</form> ; {' a7 X" n0 L, C! u
<script>function BgButton(){ 1 v- I- P: C4 Z) u. t `$ q
if (document.bgColor=='#00ffff')
0 T% N% O( I& X: f& I0 `{document.bgColor='#ffffff';}
+ W8 \4 T% r, _else{document.bgColor='#00ffff';}
( S6 D( P' ]! Z8 d2 Z. l} " t, z& b1 s% H9 j5 @
</script> ! k8 B k7 T2 u6 q
5 ?) b1 J* Q8 `) b$ J2 \9 q4 r
检查一段字符串是否全由数字组成 $ s3 W( t4 U* F T8 o' K4 c/ m
<script language="Javascript"><!--
+ Q* F) D6 m4 V2 A% n) f* f, mfunction checkNum(str){return str.match(//D/)==null}
- {8 A2 x' V0 `' a: n8 C0 falert(checkNum("1232142141")) 0 j5 x2 y+ }7 q5 z/ ?, h. y
alert(checkNum("123214214a1")) * j c% P+ L- Z: ~' v- a& z, r
// --></script>
9 B5 |. b3 ^- B- _: J$ S' j; @+ X X& o1 u- o9 u: |
判断是否是字符 9 m4 T) W* F8 c+ u
if (/[^/x00-/xff]/g.test(s)) alert("含有汉字"); * V7 t9 L! h# e. w i" w* B
+ D+ J' ~7 C+ _7 I5 K3 {
点击刷新代码: 7 j5 g# p* B! _* l1 ~% v! w' m) ]
<form>
% q J6 A( W% [3 N0 M<p><input TYPE="button" VALUE="刷新按钮一"></p>
* V% x' B, z+ K, z5 Y</form>
9 J; T; R* p2 f; Q2 X<script language="JavaScript"><!-- 6 H' Q7 y) H* v) u: z( G
function ReloadButton(){location.href="allbutton.htm";}
( T$ v6 b! ?. H- e9 F l4 ]0 l( J6 P// --></script>
4 c* S5 p* h$ q0 {$ [
1 z. W% |" P) r$ H让层不被控件复盖代码:
+ f& f) b8 x9 s: k0 K: E, M0 E<div z-Index:2><object xxx></object></div> # 前面
& ]; s+ x8 e! A<div z-Index:1><object xxx></object></div> # 后面 " x4 h5 M. q9 K( a5 Z; y1 M" b
<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>
& D. z* o+ Q- y<div id="Layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div>
$ y6 a' Q V; } C7 k6 Y" L* ~' {$ J, j5 L. O
让层的相对定位
* o7 H$ a$ S _1 C9 a<div id="Layer1" style="position:relative; left:0px; top:0px; width:0px; height:0px;z-index:1"> - @1 E9 |4 R! g. |
<div id="Layer2" style="position:absolute; left:500px; top:0px; width:220px; height:220px; z-index:1">
( j$ l4 p1 |- H4 Q! W% K" g内容
1 ^* s' [) n+ ^9 q8 }' i( b</div></div>
0 J o5 J9 u# Q/ v
6 I; F% n, J$ V3 J' X; HFlash代码以及背景透明
) B) s, z' X1 F! w! P$ H+ p<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="200">
1 }* c" g3 y5 j" a! v8 P<param name="movie" value="文件">
! l: b" G# ^! d# E/ @& ^6 f4 P( {<param name="quality" value="high"> % B. w0 j1 a- I) D" K+ N; g" L
<param name="wmode" value="transparent">
- }7 |6 k' o) i" z* x$ p<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> |
|