TA的每日心情 | 衰 2019-8-18 09:37 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
点击返回上页代码: 6 [1 D6 \- B1 [
<form> ( O, v+ a$ C# A$ [5 O
<p><input TYPE="button" VALUE="返回上一步"></p>
& N* ^1 S: H v; }; G* v</form>
0 p( ]/ J. ~) v7 w1 G% \, \1 Z
# ]; O: x* }1 R7 n) B' P弹出警告框代码: 4 O- _" @! x$ p3 n: A) K
<form> . s- `; D& L4 t' l! G# T
<p><input TYPE="button" VALUE="弹出警告框"></p> ; Y0 l+ |1 i) F$ f+ b0 s9 p4 ], Q0 Z
</form> ; f+ |2 b7 e/ M% B9 j
<script language="JavaScript"><!--
& b1 K' j* y3 u) [function AlertButton(){window.alert("要多多光临呀!");}
6 ~* D# T& x7 r4 ~) o4 j// --></script>
7 r- w3 v1 A0 U) `7 f2 g8 `* H: Y, c% J1 t3 J
点击打开新窗口
2 o, |" U2 i2 E1 g( E2 q+ n" j- {<form> D, [6 t- b7 i5 S5 ^& R
<p><input TYPE="button" VALUE="打开新窗口"></p> " R5 Q( s! k* B6 I
</form> $ J0 J' [1 i' g9 D
<script language="JavaScript"><!--
2 L# z- `2 G* P5 d3 xfunction NewWindow(){window.open("http://www.mcmx.com","","height=240,width=340,status=no,location=no,
# q* c3 }1 N5 ]toolbar=no,directories=no,menubar=no");}
9 n1 W- W) p1 L' ?// --></script></body>
5 ~, G" e5 Z; ^* p4 `2 q
6 r) O3 }) L, P& y; v删除记录时弹出确认框: & O* `. n# d! N0 l: X
<script LANGUAGE="VBSCRIPT">
Q- Q6 a3 Y5 N6 G8 X8 a# qa=msgbox("真的要删除该记录吗?",1,"注意")
( k5 r& n J, ]if a=1 then
6 Q4 n" B- d2 U7 X) A8 b' \location="Dodelete.asp?id=" //指向执行删除的页面Dodelete.asp
* ~- X4 A' y* C5 S# l( \else 6 F8 z8 n5 |/ N: b5 M: C2 B$ `4 v
history.go(-1) 4 y1 J& m. f% g4 l
end if + C# |3 j& P2 T1 z6 U8 c; m {
</script> * @, C. ]+ m5 v# S) @5 v
1 i% T: Q p9 f! e$ R
关闭打开的窗口 ' i# M0 h+ W7 G, ?- c4 U
< a href="/">关闭窗口</a> $ r# \+ {' w3 s& A0 ^0 C
2 x8 m$ t* l" r4 D b! ?
清空INPUT且选定 # D; a, U0 D- q$ N: Z" d) ~4 ^+ p
onClick="Javascript:this.value=''" / ]. f6 _# U$ ~# ^3 {- j
7 O) ^- [7 \1 Y4 M( u- u右键屏蔽
" d: I# v# f& w/ U" E<body oncontextmenu=self.event.returnValue=false>
* {7 c J+ f: r% S e9 p; C2 i+ W) S V4 z' l/ p
连串英文自动换行的解决方法 IE5.5 3 N ~7 I" ]8 W) g
style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word" 你可修改为指定的大小如 200px ]1 F `4 D5 ]5 e8 I' E" A8 ~) N
' d8 y( p* ~1 Y, W% |$ e图片“重置”按钮
, a$ ~$ Z) d6 ~0 E$ t( u; X# }<script language="jscript">
$ g! c1 c( z. z0 A* B$ i4 ]function myreset() ! z* l# A- {0 c: P# u7 V' x
{ document.login.reset(); , h9 U% Z6 T U! Q7 a
document.login.focus();}
9 f8 x- L* u) y</script>
5 S; v; e5 R0 r4 P8 ?+ c<img src="image/reclear.gif" width="69" height="20" style="cursor:hand"
* Z8 |# t0 Z* _, Y# J; U9 t
9 L( e! y6 d. L! ]/ C/ X; v: T画细线表格
: x- ^, t* r1 c' Z! k5 l<table style="border-collapse: collapse">
; i/ l( Z* v6 ^" f. Y' R2 P' ~1 J [; ~
状态栏信息 & V. ?& p- L. g: k# J4 g7 f" p
<form> " r, n4 @% ?1 D z! I( l8 m8 Z
<p><input TYPE="button" VALUE="状态栏信息"></p> 5 d. G X1 X0 Y# z3 m1 A
</form>
' R5 T. g h S& k8 x/ `- D<script language="JavaScript"><!-- 6 }) J0 s3 \4 r( C4 U
function StatusButton(){window.status="要多多光临呀!";} 8 a! c& _! K0 P0 F
// --></script>
' F1 M- {/ f7 `
+ l; n+ @3 H: g- p3 E最小化、最大化、关闭窗口 7 b/ ^' w5 _! z2 [& e& S: S
<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> 3 B% c6 u: @9 ^) f# E
<param name="Command" value="Minimize"></object> 7 @3 ?, l0 a0 Y# i+ U
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
, A% Y3 A& W1 S" d# a( c6 B7 w<param name="Command" value="Maximize"></object>
6 |6 A2 I k' g1 K# v8 l; w* |4 ^<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
- v: V! K. f) |& J<PARAM NAME="Command" VALUE="Close"></OBJECT> - f( v% D: J0 Z2 @% S3 A8 K
3 T' m$ f. o8 L0 Q+ N<input type=button value=最小化 onclick=hh1.Click()> : r' y4 G8 W5 h' ]6 V
<input type=button value=最大化 onclick=hh2.Click()> , N- E1 g4 W, Y
<input type=button value=关闭 onclick=hh3.Click()>
! f' a, S, H9 H6 D本例适用于IE
- e! j, ^3 ^: i- H0 o* a. Q4 {; h; ]* i
隐藏状态栏里出现的LINK信息
& |, |: n$ R. |7 u9 B; u<a href="http://";>梦想天空</a> # Z+ V6 H$ [ w0 ^0 S
# d8 ~8 ~% R: d* u0 l1 W& B文本框自动滚动条
/ E$ ^ Q) C C3 H- @4 ^6 D; E- ^<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> % X" j d, K9 i4 n$ [, G
9 o- c3 e! _- n$ F' t全选并复制
$ ]* Z: S( m2 t0 U: R! b3 {<FORM name=test><INPUT type=button value=全选并复制><BR><TEXTAREA name=select1 rows=3 cols=46>你好,欢迎您的光临!</TEXTAREA>
( t$ u' O; |- a8 ]</FORM> : k4 u g( b* m3 O5 Q7 q
<SCRIPT language=Javascript>
% M* A+ Q" e; `, D8 m- [<!--
6 q) G/ p, J1 N( s2 U) y% m! e- s( X4 q; Z3 S: u
var copytoclip=1
, F k0 v! F2 ?2 q
! m1 y* n* e; p& N/ d/ d% c _function HighlightAll(theField) { ( ?1 ]; r. o Z; i& U& U+ _- o
var tempval=eval("document."+theField)
7 `/ D- h) K/ Ptempval.focus() / Y' _+ b: l/ M J
tempval.select()
+ X ?1 u [: i8 v& s' c' @7 yif (document.all&©toclip==1){
" T$ z+ F. ]% G0 D9 [$ A- p+ utherange=tempval.createTextRange()
: T4 r/ V) X( X+ N8 `+ Etherange.execCommand("Copy") 0 i: w* q+ O# X6 W3 @
window.status="Contents highlighted and copied to clipboard!" 1 M+ x: Y/ H! ?7 X
setTimeout("window.status=''",1800)
- T; y: R+ R3 ]}
6 z1 m$ `1 W7 N `/ t} & _3 H7 m2 Z. K0 X; a
//--> : s8 T9 A0 _9 B- a- z
</SCRIPT>
- _1 |7 w3 [5 c6 [6 L5 z1 P& ^; q: {( ?' T
屏蔽JAVASCRIPT错误 % v4 v* n0 V, \+ y
<script language="JavaScript">
5 K( O" a9 a- B* A9 A5 s, a<!-- - d! H; J8 d, o9 @
function killErrors(){
7 _/ D! m j* Freturn true;
& X3 |+ Q( R8 g- X} & M# a. A: W: q. _! D
window.onerror = killErrors; & J0 }- k9 d# w
-->
1 m/ }( ?& Y* B7 U/ C+ s2 x</script>
: R$ J0 m% A2 K- G/ T1 ?/ Y
& e/ z0 D# s4 C n2 l1 [关闭子窗口时刷新父窗口 & q& I. l7 z0 Q
<script language="JavaScript">
1 F T5 s3 G7 ^8 s<!-- 9 q: e0 p. W" h5 o8 c! k
self.opener.location.reload();
& I5 v0 D3 y, }! jwindow.close()
- i- ^! b+ a7 p, K8 H--> 1 c9 C0 J) P; Z+ D5 i4 Y
</script>
# W1 g9 e2 _2 k4 Y N! w# g3 h" o
- ~, d0 L8 a9 N9 p1 C) D$ X" K背景色变换
% L4 L' [ A8 _- _<form>
- X N1 I# b# v: Q5 q<p><input TYPE="button" VALUE="背景色变换"></p>
' {5 T3 M8 i6 y P0 s; m! }</form>
* Z0 p a: J8 @3 o9 ~" {, N<script>function BgButton(){
; m2 S! Z3 r- f% P; Q" zif (document.bgColor=='#00ffff') - t" O9 P- E: d/ Z
{document.bgColor='#ffffff';} . D8 `& g2 T, z- @5 Y3 ]
else{document.bgColor='#00ffff';} 9 K- E! e! E. {/ w( O9 L+ {+ E
} + T# J3 ], o0 E+ Y0 g' A
</script>
: Y* O9 }1 F# g' k) O( x5 q
( P, p+ g& c# u& m4 ~检查一段字符串是否全由数字组成 + Y3 c \' s i S$ [
<script language="Javascript"><!-- 2 J" j& B2 u0 z. ~1 ~- o
function checkNum(str){return str.match(//D/)==null} + Q3 {# |, x; s
alert(checkNum("1232142141"))
5 n* a+ s4 _: ^3 x U! Qalert(checkNum("123214214a1")) * K! E$ k9 q, E$ u& Z+ @* o
// --></script>
9 l) T5 l) L+ \9 [* L1 n; Q9 {( G; K8 X. ]$ s0 \
判断是否是字符
1 [2 `* i* Y3 O nif (/[^/x00-/xff]/g.test(s)) alert("含有汉字"); . m1 M, E. p* G6 N
5 d) M. Z2 M, W* ]
点击刷新代码: " g' r' D. A# l
<form> + v" Y# C0 D: _& \' c
<p><input TYPE="button" VALUE="刷新按钮一"></p> 0 b! X( @. {7 O; H" [0 H1 x8 ^' P
</form> ) l( W5 ^! h* X$ U0 l5 B
<script language="JavaScript"><!-- # z: N9 s! G* r, F# ~
function ReloadButton(){location.href="allbutton.htm";}
, _) B P+ m% ~- n+ w// --></script>
8 c; ^' n2 I' u( y! {9 Q1 ~% O& u/ b( I7 R4 u3 V" z0 d0 V) i
让层不被控件复盖代码: 6 ~& |: P# e3 U1 D
<div z-Index:2><object xxx></object></div> # 前面
- K, F* m4 W$ v7 ?* o; r, I<div z-Index:1><object xxx></object></div> # 后面
+ @4 ]2 I \4 h2 ?# h<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> 5 e, b; O; ]! F
<div id="Layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div>
. [& D/ X- |4 P- D$ I2 e# \4 p2 I
让层的相对定位
0 h1 ?2 u6 X1 p8 C<div id="Layer1" style="position:relative; left:0px; top:0px; width:0px; height:0px;z-index:1">
. x* \' E# R3 a3 _+ `: u0 ?9 K: H; g; ?<div id="Layer2" style="position:absolute; left:500px; top:0px; width:220px; height:220px; z-index:1"> ' @& _* U. z) i! C" M6 a) S
内容
; R7 Z4 Y @& X2 \</div></div> $ T5 o9 R# p L3 w* L/ G5 E- v/ p
- V2 O5 ? l/ ?+ |+ P/ v) o
Flash代码以及背景透明
6 v; N6 ^9 R. Z9 J- w<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"> 0 _* D2 I; T# D. o
<param name="movie" value="文件"> ' [! I' D. N' f" u
<param name="quality" value="high">
1 v" J$ N0 w. A9 l<param name="wmode" value="transparent"> ' l! y. n- |% E) I4 H8 U9 j
<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> |
|