TA的每日心情 | 衰 2019-8-18 09:37 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
点击返回上页代码:
# d9 F% b* G' n3 e( L9 K) B<form> & S! P1 x$ ]& @( M# n4 d
<p><input TYPE="button" VALUE="返回上一步"></p> 1 f: Y* @% ^; d2 q+ P/ L
</form>
( ?, q: c/ y& d @" W2 _% ?. |7 h( @0 B" `
弹出警告框代码:
! J+ V/ o; e0 n6 X3 |$ p7 t<form>
1 l0 H. C# ?- k' }: d$ J7 S: g<p><input TYPE="button" VALUE="弹出警告框"></p>
7 y: R% Z, x5 k; ?" v</form> 6 D- K% l) ]* f$ E
<script language="JavaScript"><!--
9 q& H0 V* l4 f# s7 F* Kfunction AlertButton(){window.alert("要多多光临呀!");}
! T4 b, s/ _% q; v0 G// --></script> + H. K2 I5 {+ G1 O! a1 h4 B
5 f+ ?0 A' d e0 } y点击打开新窗口 5 h7 R5 R6 ]" l6 j7 f0 e& H: T' S3 }
<form> " x( ^- ]5 p) ?. `1 r
<p><input TYPE="button" VALUE="打开新窗口"></p>
) M! w; d# T! g: G6 a7 X5 f</form>
% b9 q8 L. G1 x<script language="JavaScript"><!-- + q7 Q' r+ x$ C" ^# U9 s/ h3 G
function NewWindow(){window.open("http://www.mcmx.com","","height=240,width=340,status=no,location=no, 8 n+ t$ E3 T+ C* k# X+ v% i
toolbar=no,directories=no,menubar=no");}
/ ^ A- l, t: }. l// --></script></body> : h6 i4 U( u) o0 a& X
+ ?5 r4 O( e/ A% }
删除记录时弹出确认框: 0 d# F! _* ?% v7 ^# l( F: m, b/ A- x
<script LANGUAGE="VBSCRIPT">
* f" `2 x0 R0 Pa=msgbox("真的要删除该记录吗?",1,"注意") ) O6 z" U" O2 n8 y l+ ^) s
if a=1 then
1 w' r9 ]9 J# ]5 n+ C9 |location="Dodelete.asp?id=" //指向执行删除的页面Dodelete.asp
, {6 J( E# y# f! [# d9 felse
) i, ]5 D5 w" U. Uhistory.go(-1)
7 d: H: e( Y1 Vend if
- Q. q/ P$ u' J A</script> . S9 d/ x) f; H, C+ L% f4 x
/ r' C$ m7 Y% o( l& J: w关闭打开的窗口
, N6 `$ O' x4 K" @& a* u& `< a href="/">关闭窗口</a>
8 z. I' B* @$ e% x9 l. Q( c5 ]: I1 c0 }$ Y; ?& w/ T
清空INPUT且选定 0 @& A/ l# u7 O! |1 Z' e4 D* C0 Q+ U
onClick="Javascript:this.value=''" 4 C. d8 H. Z! y: Q) D) Y8 E4 Y
7 F+ F' }8 S( i t* f s2 w+ J右键屏蔽
" H) W6 X) `/ Z6 m<body oncontextmenu=self.event.returnValue=false>
|6 t$ T/ K+ ?1 ~+ A- ?
1 b" w3 J, ?/ O/ |! J7 k连串英文自动换行的解决方法 IE5.5 ! K9 ~8 P0 E9 a" b
style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word" 你可修改为指定的大小如 200px
6 q$ A6 u* F: P; ~7 e$ C) c# E3 q6 }- P
图片“重置”按钮
9 P) O. C9 a4 X0 n0 `- B! [$ n<script language="jscript">
) p9 z8 w' m7 p. n# v6 H% g* Ifunction myreset() ( i& Y( e3 g* G$ w# \, a
{ document.login.reset(); $ B2 X) V% |% ~; n$ x- C9 `& Y7 G- w
document.login.focus();} ) ?+ V1 g* ~( V$ N& |, U
</script> 1 F+ m0 ?3 ^' T8 B, ]! V
<img src="image/reclear.gif" width="69" height="20" style="cursor:hand" 6 ? H+ ^2 _; T6 A
8 M& M" R4 A" T& Q! H4 a, I画细线表格
! V9 z4 }, U7 L3 H; H<table style="border-collapse: collapse"> - e6 H& D/ `% {( \: K9 R2 E9 J; Z
0 `0 ]3 N. v( C& u! J
状态栏信息
( |, a3 k% [1 {( X. q! Q2 o0 G<form> 1 n% H/ V- c' w' n
<p><input TYPE="button" VALUE="状态栏信息"></p>
* n w9 x* }$ I8 |</form> 8 h2 p+ V* I1 V9 l+ x9 _/ M' [4 ^7 A
<script language="JavaScript"><!-- 9 R2 H' ~; s# i2 _
function StatusButton(){window.status="要多多光临呀!";}
4 G; [0 E# y+ u! M4 W// --></script> 7 ]5 r* ^6 a- j0 d- _( ~
% a) Q$ l$ A8 O5 Z4 j最小化、最大化、关闭窗口 + b" o7 D5 Q4 K! r3 }
<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
/ s0 q5 b: H( l7 Q: U6 W: S* k<param name="Command" value="Minimize"></object> ; ^+ L: Z* h# P d0 \- f/ P
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
' e) h/ u- F3 ^. T+ J& x<param name="Command" value="Maximize"></object> 5 L/ i) w6 t4 ~- T2 P( Q9 B" q5 O
<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
9 u% U/ Z+ O5 x8 t J* e% i4 Q$ E<PARAM NAME="Command" VALUE="Close"></OBJECT>
3 U! I1 z# m/ ]; p, {7 h: y2 j& \- U9 o* P5 b7 T9 h8 G
<input type=button value=最小化 onclick=hh1.Click()> ' P3 M! s1 X' ^+ }! v# c
<input type=button value=最大化 onclick=hh2.Click()>
/ O7 m0 d# S! N7 ^<input type=button value=关闭 onclick=hh3.Click()>
' t. W8 u7 J" ~$ |本例适用于IE
) V( J! {7 {/ q
/ O* X6 a$ [* z" V隐藏状态栏里出现的LINK信息
+ ?3 o; r) m: X* O. R0 ?: s/ Y<a href="http://";>梦想天空</a>
, e1 c$ y2 J- d
9 r) i' O/ w: s- W" j文本框自动滚动条
3 z4 x, B t, V% q<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>
$ }( z3 y3 u$ u6 R8 Y% R# G
! i5 ?5 z1 t+ F/ l3 `4 Q! x7 X全选并复制
+ l1 v/ k: n: x! D<FORM name=test><INPUT type=button value=全选并复制><BR><TEXTAREA name=select1 rows=3 cols=46>你好,欢迎您的光临!</TEXTAREA> % O3 x' t; e+ f! S- _* \
</FORM> ) y$ K% O6 R; P( U0 V
<SCRIPT language=Javascript> ( K% [7 P4 o4 N: |+ D: T
<!-- 6 A2 \) w5 G7 T& \1 t7 e# }; Q
; T' Y/ B) t0 c4 M. n0 {
var copytoclip=1 $ c) b0 }2 V0 C# t. w
$ r7 s% A6 _* J4 f8 d {
function HighlightAll(theField) { ) Q0 T6 _) S+ G8 O6 D* l+ n
var tempval=eval("document."+theField)
& d! x2 V6 p7 Q% m$ X3 jtempval.focus() 9 D7 x: h1 g& ~( F6 x
tempval.select()
$ P0 B5 A' X, U& k$ J4 zif (document.all&©toclip==1){
$ q, X8 z4 Q9 }- D5 vtherange=tempval.createTextRange() ( F1 Z) w# T' |$ O6 k
therange.execCommand("Copy")
( `1 {% {3 I7 e; t; i1 y t @window.status="Contents highlighted and copied to clipboard!" , H7 c# U+ l0 I/ t) _3 y
setTimeout("window.status=''",1800)
- {' a8 s8 h4 d3 T5 F7 X8 A}
# g8 d: t# h U5 G0 C @" r}
1 ?: x4 \4 p5 N* p, A//--> 5 P: Y& a& v" @. q/ `
</SCRIPT> . J4 u- C; p' B
1 Q& H! j: b" X$ }2 u; _& A. g( t屏蔽JAVASCRIPT错误
: \4 } `6 U1 ?4 J7 A5 Q<script language="JavaScript"> ) d$ W7 M' q' }$ c; ~' J
<!-- 5 N P- L3 `0 g4 [# S. m$ W
function killErrors(){ 6 R7 E- ^- g, ~. P( r
return true;
% M0 e* W0 d/ m1 L} 5 G. T% P1 r, V' Q5 |1 b
window.onerror = killErrors; - @) I( A: T% M; a. p/ E: _4 l
-->
% D3 q/ D* i. s, A* B+ p- e</script> ' e0 E& m6 f) j) ^7 J6 I& ?7 e
' \4 V* c/ X/ E- c- @- J8 g
关闭子窗口时刷新父窗口 8 S; ^0 l! ^& B1 G! U& g
<script language="JavaScript">
7 C. X$ X) D. E<!--
! k# w4 W5 \/ @/ b3 v( S) a' X+ X# I. xself.opener.location.reload();
* ~+ O8 a) T7 Z7 ?; W! Fwindow.close() / H: X" K0 L% p8 J3 a
--> ) {: u; L- d& J( @' B! Y
</script> 5 I. e+ _: v5 ~$ W: Z
% Q1 A W# o5 R0 Y$ B# U0 A& F6 ~1 h8 |" C D5 k
背景色变换 1 Y6 h) [2 i2 q2 G: L
<form>
' n6 x& H7 X2 T8 ]" y! J3 B* A<p><input TYPE="button" VALUE="背景色变换"></p> 1 T8 H+ t! a+ Q4 S+ \/ q7 u8 ]
</form> + k$ S4 \# M, M
<script>function BgButton(){
; ~' Z$ j8 {- ~* U+ _; h4 Y# _if (document.bgColor=='#00ffff') 3 x( \( A; c4 a
{document.bgColor='#ffffff';} ! ~7 _& W. L. g$ W( H2 L
else{document.bgColor='#00ffff';} 7 g9 M T$ M2 {2 h' J# `
} & u9 M3 v& @1 F& H* i
</script> _% B$ |+ S' y! ^4 U
& q! P s) Z+ b: w) P8 f. b检查一段字符串是否全由数字组成 % L$ K8 I! H$ J2 l9 v) K
<script language="Javascript"><!--
2 I' T- e1 \( C' Y3 M4 Cfunction checkNum(str){return str.match(//D/)==null}
) u* ~7 `$ T) d. oalert(checkNum("1232142141"))
, Q% B- {3 ] ralert(checkNum("123214214a1"))
/ p/ a9 n% E# K// --></script> A8 ^/ F: g2 J9 s
5 L+ J5 Y: A; V
判断是否是字符 8 W. I0 v: _2 G: v& v! U; {: k
if (/[^/x00-/xff]/g.test(s)) alert("含有汉字");
/ i8 O/ U6 f A& o3 [8 i! A
4 i, M" ^/ l8 S! r$ `' s点击刷新代码: # g# Z2 D# c1 A, M+ o1 q, ^
<form> 1 g; L$ c# Z* l
<p><input TYPE="button" VALUE="刷新按钮一"></p>
% Z8 `$ V$ _; r& J* j' `</form>
- i3 P: Q, _* [3 ^+ `- I$ u. Y<script language="JavaScript"><!--
9 C- f) [6 _. ~6 f- f8 ]$ b4 ]function ReloadButton(){location.href="allbutton.htm";} . y2 X5 e8 S& c4 _* D* e
// --></script>
& @9 D. e6 {+ D$ J5 l# ~1 w
$ d* B/ I2 R, G ~0 K: n& d3 h让层不被控件复盖代码: 7 `, ?% F8 g# f( M* T c
<div z-Index:2><object xxx></object></div> # 前面 ' j) K2 S' K& X! Q
<div z-Index:1><object xxx></object></div> # 后面
+ B" {. E! a. F( v; X6 [1 D<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> 0 G% J% V9 k. m% W) a& n
<div id="Layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div>
1 H+ s( {+ r( W" e: V8 \7 l( f/ c; X
让层的相对定位
8 ~8 e- J; _" F* a- V( G<div id="Layer1" style="position:relative; left:0px; top:0px; width:0px; height:0px;z-index:1">
7 _3 I% p% l3 B( x2 g<div id="Layer2" style="position:absolute; left:500px; top:0px; width:220px; height:220px; z-index:1">
/ |5 d) E; ~1 V& f6 }/ Y/ x/ U& T* z2 s内容 ' ?' C& y, S9 ^; o
</div></div>
) Q4 S% n; p# K9 i7 u& k+ n
- W7 b" Z* V: s7 V: }+ J, n& @Flash代码以及背景透明 4 \( }1 J. I6 R* m) }/ N
<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">
+ D# c* @* U, a8 A<param name="movie" value="文件"> % V2 L3 |, [ Q( _: D* `
<param name="quality" value="high"> 7 r7 w, f1 B* f0 k" s/ j) r8 Q
<param name="wmode" value="transparent"> 8 d- t; X, P! t; 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> |
|