TA的每日心情 | 衰 2019-8-18 09:37 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
点击返回上页代码: & q; I/ c2 ]9 g0 e$ c. S C
<form>
5 i" Y9 i" F0 |; H% L3 o<p><input TYPE="button" VALUE="返回上一步"></p> 1 T, m7 N' @% x* G
</form>
R4 U* S/ I. T8 {1 l, s$ o' o; V) X a
弹出警告框代码: 5 A" L6 j& r/ y8 [: u; t& G7 M8 e
<form> 2 J4 T$ D( |# a0 J& I
<p><input TYPE="button" VALUE="弹出警告框"></p>
/ d# _: j6 a/ S1 ]1 g6 E</form> 9 y8 `; b& P4 M3 o8 e" E+ \# L( B4 Y
<script language="JavaScript"><!--
8 K% i3 o7 P$ O" [8 Dfunction AlertButton(){window.alert("要多多光临呀!");} ' }; O% r; N% s; n
// --></script>
4 p" I! e/ I( ^+ w
- L' {6 s7 m E' R6 e( ?3 U点击打开新窗口
. R+ v( z1 |0 r<form>
# R% ?1 K s3 {4 M( h' ~. {* J<p><input TYPE="button" VALUE="打开新窗口"></p> . F" O# |# j& {* \$ e0 A( G
</form> * i) o/ l- U5 u4 |* C
<script language="JavaScript"><!--
4 h$ t" n& `) T6 Z3 n' kfunction NewWindow(){window.open("http://www.mcmx.com","","height=240,width=340,status=no,location=no,
( L+ u% g$ U2 O/ {toolbar=no,directories=no,menubar=no");}
# b6 c8 C, X* Q* D7 c7 ~0 _: A' }( d// --></script></body> % u- ~0 X8 w8 m- R
" R4 E- z- v8 h5 ^: k4 s# F; U$ U
删除记录时弹出确认框: 0 a- d2 l0 Y6 D0 Y/ o
<script LANGUAGE="VBSCRIPT">
0 u% W, M4 S& Qa=msgbox("真的要删除该记录吗?",1,"注意")
+ j) a6 b+ x7 r1 l8 wif a=1 then
0 B( B$ Z( d5 M* c9 {: v% f- L/ klocation="Dodelete.asp?id=" //指向执行删除的页面Dodelete.asp
+ {9 e; W, U& T O6 T+ N/ zelse
^7 j% m4 A% |& Khistory.go(-1) 9 v6 `& g R' S) E7 S) N
end if
+ J- l( L$ W6 Q: J. }5 `! f</script> 8 j( }* T. z( Z; c
' r1 K" r1 p, Q8 _- j关闭打开的窗口 , P9 {) I( O+ ~4 T) e$ {4 ~
< a href="/">关闭窗口</a> $ H- @8 { R7 l
+ R5 X! Z) K! h7 Q
清空INPUT且选定
9 Y5 k9 }: i. A3 O8 S& U% I: \onClick="Javascript:this.value=''" 1 ?0 {; ~3 K& K4 \, y4 H G: w
9 m; q- G$ b- c) x' i) I! w! V- p+ ]右键屏蔽 " B3 `7 l% p. Z/ \
<body oncontextmenu=self.event.returnValue=false>
# }4 d7 K$ H$ ]# g7 m9 o
5 H+ Q- ?( Q n2 h连串英文自动换行的解决方法 IE5.5 # ]. L' v' `8 w) M
style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word" 你可修改为指定的大小如 200px
$ y/ C3 f- x0 P+ w# v: }$ G1 W0 E3 n# n
图片“重置”按钮
/ V1 i* L1 ?% Z5 ]3 _<script language="jscript"> 8 E/ n8 ?/ v+ K4 r# _9 a+ w
function myreset()
! _# v! _7 V: \8 _1 g! m{ document.login.reset();
* ~- m9 t. j- [3 D8 n" I; Wdocument.login.focus();}
3 _/ l# h9 t: l( a) r- J</script>
% S3 B3 U1 m T2 y _<img src="image/reclear.gif" width="69" height="20" style="cursor:hand"
1 k J4 I/ f% p8 @& K
e5 u8 S9 U) W画细线表格 7 ^7 E0 g: E3 m( X7 {
<table style="border-collapse: collapse"> . _! e: F, E2 u% ~: Q
* V j- _: |3 l6 m$ _状态栏信息
+ \' O4 m8 \8 W1 H/ p$ r1 q<form> ' j6 q& P" M& G! a
<p><input TYPE="button" VALUE="状态栏信息"></p> 5 ?6 R5 K" \. f
</form>
8 V' _: l v+ G: S8 l8 x<script language="JavaScript"><!--
_% u7 t* v) a! Jfunction StatusButton(){window.status="要多多光临呀!";} & ]9 }6 t9 C# E1 Y& r
// --></script> 9 i+ o7 l$ o, X3 u1 m9 l
4 e1 }2 ?7 m, d: w
最小化、最大化、关闭窗口 / p- \6 u# u! u
<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
9 ~4 ?% [9 b$ e# t% [8 {/ }<param name="Command" value="Minimize"></object> 9 Y9 H/ F7 m. Y# m
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> $ z0 W' }- T, A; G
<param name="Command" value="Maximize"></object> " y$ q, F$ Z6 }" d2 t9 l# N
<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
2 P+ Y& l8 R& x: U7 `<PARAM NAME="Command" VALUE="Close"></OBJECT> 4 s: L- ]6 g, j+ m- m) {
$ C' U- G/ r2 o6 V) I3 S C. q
<input type=button value=最小化 onclick=hh1.Click()>
4 P% A' R+ z' @<input type=button value=最大化 onclick=hh2.Click()>
! u0 N# O$ K2 g+ m6 P6 Y0 U<input type=button value=关闭 onclick=hh3.Click()>
, {# W, ~+ ]$ w! q) h本例适用于IE
% u, W* d8 q2 E4 \; R
( {$ W4 n9 x. y& j: w; Z* ^隐藏状态栏里出现的LINK信息 : Y2 h& T3 A Y S) E
<a href="http://";>梦想天空</a>
3 Y4 }/ P: J: a/ V3 m5 Q H- l7 K3 z1 N. e9 t: h
文本框自动滚动条
: B0 m2 s2 G# U" C! T<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>
8 l/ _ F) m% p/ E. c2 B$ |
% @* [, j3 T0 e- h全选并复制 ! d- m5 t! n' A$ E- f
<FORM name=test><INPUT type=button value=全选并复制><BR><TEXTAREA name=select1 rows=3 cols=46>你好,欢迎您的光临!</TEXTAREA> ) w9 k6 \" _( v4 M) b2 n- v
</FORM> , A# S1 t9 G- `# L/ e
<SCRIPT language=Javascript> 4 B9 f* P* T6 J8 }3 p. e7 W1 x( @
<!-- 1 q4 C' |' ?9 b7 }# Z
. E% T! C3 _8 V: g
var copytoclip=1 5 w% e n! Q7 L$ o; f
6 p3 D$ m% e P0 S/ d- N" Ufunction HighlightAll(theField) {
0 w* {5 d3 v) O' P7 U" Ovar tempval=eval("document."+theField) ; C+ r% x9 v6 f' Q
tempval.focus() " C# X5 V% F' ~, w4 G9 m
tempval.select() ! ^! ^1 V9 t) @5 o
if (document.all&©toclip==1){
8 }' r( S9 f9 |; u2 s- T0 K# o3 stherange=tempval.createTextRange()
/ v! r0 s) O# `: ^ q& Ktherange.execCommand("Copy") * v8 M% M* C' F9 F$ a8 O+ T* T. n
window.status="Contents highlighted and copied to clipboard!"
3 {% y. w! [# d4 T7 `setTimeout("window.status=''",1800) 0 W9 @: I3 G% G$ ]$ C, b; s
} 1 B8 y; I9 T, W6 F
} ; @4 f5 E4 A3 p9 R: i& \
//-->
+ r/ j+ R0 a" f* c" b1 ~, y2 z</SCRIPT>
1 Z( E# M/ m" n- t$ i( d1 S* `! m) |
; s: F# P; ^2 w9 f屏蔽JAVASCRIPT错误 4 g! ?/ K% {# f8 t' g3 W
<script language="JavaScript">
' _7 L! q, d+ e7 c# c6 ]2 y<!-- 7 Y. P$ J2 t; e* y) h
function killErrors(){
9 O( P \& x8 ?* J5 U9 c3 L8 _return true; + [' p# f1 \& P" N; n& |( L n$ h
}
. s1 C+ h( x# y( V6 twindow.onerror = killErrors;
& C, r7 d; d8 J# B2 N2 D-->
4 v2 ^: ~9 A* _2 f; D4 t* ~- }4 `</script> ; {8 m9 W4 {. {% D/ C: r
" b* T b+ \- z( d/ `1 v* p% o% o关闭子窗口时刷新父窗口 % @( S4 X9 o0 }0 E; ] k
<script language="JavaScript">
% q3 s- G$ J3 M# t# V* r3 K- o0 o<!-- 3 g7 s/ \3 J: L- r! l1 d5 c
self.opener.location.reload(); $ X: q4 n* Q" f) f
window.close() 1 K$ V( u8 R: t$ E) p- D+ ?; y
-->
+ X* E0 W1 o" s: T5 s% D9 u</script>
9 i5 U6 i' u. f8 c/ W" K) n. q9 u
$ R. N, [" w+ [5 U
1 M" { ?" U* W) z- W背景色变换
( T1 M: k' s. h5 w, f* j" D<form> + f P4 e5 T/ F' Y! z
<p><input TYPE="button" VALUE="背景色变换"></p> ; m8 z+ M3 `$ z q; x2 k0 c
</form> 5 S. p* t* G" W7 C. O2 S
<script>function BgButton(){
) u5 | e, Z8 S, X/ [, U lif (document.bgColor=='#00ffff')
5 r5 l/ c! z! w' v! P0 I( E1 S{document.bgColor='#ffffff';}
' b @- ]8 y# O/ a1 F1 ^else{document.bgColor='#00ffff';}
E& i+ }8 A+ }+ O6 p8 r" A: r6 C3 m" R} ' E* |6 e' l N2 A; \. m3 l6 e& R- W3 I2 m
</script> ( A/ T: f+ _8 w3 Q) {
. p9 a7 j# i# V7 n4 p9 X6 J) L( Q
检查一段字符串是否全由数字组成
$ V s. o. g: Z; V* o<script language="Javascript"><!--
& g- _2 K1 d6 N' Y& q0 Ufunction checkNum(str){return str.match(//D/)==null} - L! [- o9 p0 M
alert(checkNum("1232142141")) - ]% ~( P9 n; l9 @0 q+ Z
alert(checkNum("123214214a1"))
: {; K/ P# @/ X P, [" M// --></script> 9 U- ?, b" D2 t! u, y) \# x$ \( M% U u
. S/ V5 _6 n2 a0 F7 E5 A
判断是否是字符 2 z0 Q+ z8 m6 k! o. ?- E' V( H# b
if (/[^/x00-/xff]/g.test(s)) alert("含有汉字");
$ r/ ]! I Y$ _
3 A9 H$ ^+ {: K点击刷新代码: : E& p; ^2 [2 f+ V
<form> 5 q1 K' m# g- b
<p><input TYPE="button" VALUE="刷新按钮一"></p>
6 E: q6 M+ O; U k4 ~6 G5 H</form> 0 f# c' R6 |% W6 ^1 }
<script language="JavaScript"><!-- ! B; _ a8 Y7 P/ L! d
function ReloadButton(){location.href="allbutton.htm";} ' s' T! B0 `+ z7 r
// --></script>
) d7 x1 k9 b2 i' d/ L+ Y
6 b0 B% B3 y6 Y* a让层不被控件复盖代码: / x+ f) b. g h3 i
<div z-Index:2><object xxx></object></div> # 前面
3 I9 }3 A6 H# L& Z3 c+ H<div z-Index:1><object xxx></object></div> # 后面
8 }# t: ]( b$ o) m<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>
, j9 u' v: X8 s<div id="Layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div> - @8 S, C4 Y" w" j3 w0 e* i2 @6 A8 L
0 P$ E& P% y2 H& g3 x' s让层的相对定位
/ C, c6 ]' d8 W5 Z+ e<div id="Layer1" style="position:relative; left:0px; top:0px; width:0px; height:0px;z-index:1">
' p5 C5 t7 o7 P: E# w$ W7 @. ~<div id="Layer2" style="position:absolute; left:500px; top:0px; width:220px; height:220px; z-index:1"> $ U! _' V& @/ F5 o
内容
3 ]) U4 f) Z* u! E! r( ~</div></div> 1 ]: F+ ~; G' ]5 @* ^
1 G5 L6 v8 v1 G+ tFlash代码以及背景透明
_/ ~* i& M" J7 i<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 \" F! I0 T$ m
<param name="movie" value="文件">
4 t. K7 i1 t; K* ]<param name="quality" value="high"> ; U! I z+ N. v; I1 n4 K8 i6 C
<param name="wmode" value="transparent">
% C$ c. q2 E" C* K5 o9 l<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> |
|