TA的每日心情 | 奋斗 2021-5-1 20:26 |
---|
签到天数: 2013 天 [LV.Master]伴坛终老
- 自我介绍
- 数学中国站长
群组: 数学建模培训课堂1 群组: 数学中国美赛辅助报名 群组: Matlab讨论组 群组: 2013认证赛A题讨论群组 群组: 2013认证赛C题讨论群组 |
发表于 2019-3-23 13:35
|显示全部楼层
|
|邮箱已经成功绑定
- 事件源对象 2 Q1 q) O$ V& U8 {. [; a* j8 K* x
event.srcElement.tagName
3 u @* D) y9 d5 X/ levent.srcElement.type# b" c) a' f/ G9 ?7 r: n3 G
; y, h7 S' a& D l# f- g+ j! y
捕获释放 ! L8 s4 G+ U" B" f ^
event.srcElement.setCapture();
0 o2 e+ ~2 ~; L" c! bevent.srcElement.releaseCapture();
' F0 K4 F& A6 K f3 i5 x4 Y事件按键
- J) X' X2 l& b3 i$ tevent.keyCode - `/ }' y' z0 d: X) k0 u8 q* U6 z
event.shiftKey
# j* L+ o J2 Y) Q: c4 aevent.altKey 7 H* |, Z) K6 X# ]4 F6 ^$ S; X& S
event.ctrlKey
' |3 j# c% y% r; u3 m: r" p事件返回值 # q' f# D G# t- \* w* l# A
event.returnValue
# B2 ~7 w% W4 |鼠标位置 % y) }6 W* j4 G' L% R
event.x / f4 u4 P' M! w) L
event.y' @( W5 T- _$ R/ F6 J& g
窗体活动元素 # v& h+ ^" X1 G3 x. S! o- i, ]
document.activeElement
) h) \2 A( a8 p# }绑定事件
. r7 s2 e' L9 |, d1 d; xdocument.captureEvents(Event.KEYDOWN);8 N6 @0 L% p. N' }5 l
访问窗体元素
/ P T3 f d1 ndocument.all("txt").focus();
% P% g5 k2 {; d: l9 C+ cdocument.all("txt").select();8 j8 Z% I. g: Y5 u4 [
窗体命令
" r+ o2 {# \# [4 }document.execCommand
: J, }2 F% I: R窗体COOKIE
, e$ K/ k& a! }+ O" s/ t4 Edocument.cookie; u, c* E+ U+ t# J% v
菜单事件 0 W3 L! Q/ g5 w$ k5 l
document.oncontextmenu6 z/ r# O5 h* A( f
创建元素 $ y: ^! Y# s1 p! P* ^8 H. y) b( z* b
document.createElement("SPAN");
1 A- S% Q8 v: E3 j% w根据鼠标获得元素: : K2 L3 A4 w2 {% s, n- J% j4 o
document.elementFromPoint(event.x,event.y).tagName=="TD ! k1 E; }2 a( i! E
document.elementFromPoint(event.x,event.y).appendChild(ms)
# Y6 S3 l5 }8 m3 s |" ]窗体图片
7 s7 e- r: \6 S L, Qdocument.images[索引] F' s6 X- }( i
窗体事件绑定
A9 R: U f2 |( |document.onmousedown=scrollwindow;
. f0 _! V) c: R' ~( V. H. b% t$ e0 u元素 ; y. q9 _# r0 f1 S) n* `
document.窗体.elements[索引]
% k: D# \/ {, k; C对象绑定事件 ' P$ Z% Z/ L2 f- u# i2 R. e
document.all.xxx.detachEvent('onclick',a);
* m; [4 K1 g8 _插件数目
; p1 M7 i/ o, snavigator.plugins
& R; c8 g6 j6 c取变量类型
7 p: r( v; Z8 O' |6 W; A1 v xtypeof($js_libpath) == "undefined"
' [# e4 F' ]* n6 m2 b0 S下拉框
( `' a4 F( T, @. j下拉框.options[索引] % c' ~% V$ G9 W! D6 g/ y
下拉框.options.length+ o8 Q6 X* D, }: Q
查找对象
# n2 w( M) V9 j; @% v* V% qdocument.getElementsByName("r1"); 8 c% c+ W: z$ C0 x$ I4 r
document.getElementById(id);
) j: h, R* H0 ]( B" A- B3 I定时
- _0 o- X. w. u* A2 j6 P) {timer=setInterval('scrollwindow()',delay); 8 v+ Y/ u* w8 R2 n7 z" _, z
clearInterval(timer);
/ _. e/ K1 Y( R# a& tUNCODE编码 , h$ i. I% [' L* y$ m
escape() ,unescape# {) B0 l$ O9 z W8 x
父对象 ( T5 K7 [+ w" {5 g0 V q
obj.parentElement(dhtml)
) _$ D8 U. E, `- O; d3 Z( e: ^obj.parentNode(dom)) M5 A& Q+ O; s" z
交换表的行 . r' v9 C& g" y9 O1 W
TableID.moveRow(2,1)
. ?( `9 P7 q: X( t2 y) I替换CSS
! e; {4 Z' L0 A) k7 P) p7 _document.all.csss.href = "a.css";
" f, k7 H' b' x并排显示 * Z/ v6 ?( M0 a
display:inline; N2 ~5 q+ z" ~) v, b0 N
隐藏焦点 7 v0 ^' W) o2 }/ ~8 D; n
hidefocus=true' ^1 G: I0 t" ~6 \; o" ~9 h
根据宽度换行
, F5 p) A7 ?5 o! A; f7 r, astyle="word-break:break-all". y* n* ?! u; C9 p0 L' o/ e; r
自动刷新 9 W1 D9 ?8 n+ C* `! m, B
<meta HTTP-EQUIV="refresh" C>+ F- [, ~5 K: j* S8 W
简单邮件
7 n$ m7 M) _. @# L H: j<a href="[email=aaa@bbb.com?subject=ccc&body=xxxyyy]mailto:aaa@bbb.com?subject=ccc&body=xxxyyy[/email]"> ' t" l. K! I' i% ~( j/ H! }8 O
快速转到位置
* B* E( p0 {* S. J, aobj.scrollIntoView(true)9 A, e2 L0 I1 X" H9 Q
锚
. A/ d2 S2 ~/ L# q% x<a name="first"> # O$ u9 a& G, N* k
<a href="#first">anchors</a>
3 B! r( G: e% O网页传递参数 7 h1 c) \3 t5 W# C
location.search();
) T \- Z7 y: {. r8 d% u' g0 r0 c可编辑
: z% c9 G5 g2 ]# W& Eobj.contenteditable=true
6 _4 C- l/ k; y5 U5 B3 W执行菜单命令
1 r$ g, J1 x: f: P* L3 zobj.execCommand
f* u% ^9 S$ J% L0 Y: c9 l双字节字符 5 m% [& K+ f5 e3 `: K
/[^\x00-\xff]/ * p* k e8 {+ x8 p
汉字 " X2 \: U* @0 ?7 r$ `+ r; t8 y
/[\u4e00-\u9fa5]/" O% z7 }6 E: }/ v" f, o
让英文字符串超出表格宽度自动换行
) L; _8 I ?! [# M' ^* u0 }! xword-wrap: break-word; word-break: break-all;
& |3 U# S/ V+ X" V3 p透明背景
$ D' q$ l6 V1 j7 h! u% y; v9 b$ \) U<IFRAME src="1.htm" width=300 height=180 allowtransparency></iframe>
, O5 w, i; P" I( g( U" g: a9 V获得style内容 : X& q" h' x& R/ r
obj.style.cssText
$ q: D5 r; b5 H( L. J# BHTML标签 1 c0 s$ ^9 H1 D: Q
document.documentElement.innerHTML
; d% T0 N: s" K第一个style标签
. V* _% a! f& s2 m* Rdocument.styleSheets[0]/ M0 g) D6 b5 C$ n0 [9 {) M
style标签里的第一个样式
. r3 u+ A3 D2 e& N ^document.styleSheets[0].rules[0]
- S5 T, b7 ]: j3 K/ e- o: F* |防止点击空链接时,页面往往重置到页首端。
% J! i8 k( ~; q, j! N. \<a href="javascript:function()">word</a>
1 ^& B5 B/ L) V3 e上一网页源
4 z% @4 R; i6 n, y/ s, {: k6 Gasp:
$ z f! j, G/ t1 @- Arequest.servervariables("HTTP_REFERER") . A" V# k8 j. ` Q6 }: F1 } X
javascript:
3 @! o; a1 w1 e% m+ |document.referrer9 j- L6 |/ h% U$ m6 X' p
释放内存
. T h k N5 JCollectGarbage();
3 ?% O, K$ {8 j: M禁止右键 $ N$ u' P$ E: J0 M7 X' X. B, W
document.oncontextmenu = function() { return false;}
- C# S; D* E. C( ^: B( f5 T+ i8 h禁止保存
1 q: o; I y5 d: U3 c<noscript><iframe src="*.htm"></iframe></noscript>" X: ~+ }) Z3 p
禁止选取<body Shortcut Icon" href="favicon.ico">
5 u: ?2 A+ c/ t0 ?& g. kfavicon.ico 名字最好不变16*16的16色,放虚拟目录根目录下1 e4 W+ v; x4 u- f" f, s/ M
收藏栏图标 , y9 p9 \ h% q
<link rel="Bookmark" href="favicon.ico"> w# b/ r' f% r3 @: C( u
查看源码 $ y+ h7 ^; Z4 z0 H' {/ `3 T' y1 F, F
<input type=button value=查看网页源代码 >
% f9 D$ O4 Z" d' w关闭输入法 ' t% z P5 C! I: Z& b& R/ X
<input style="ime-mode:disabled">
# A% c# u" E6 f* a自动全选 v- w. f# e3 }
<input type=text name=text1 value="123" >* A# G8 P0 R8 F7 K
ENTER键可以让光标移到下一个输入框 8 K W# K* R8 ~1 F* q# Z" F
<input >
5 f) b( U* U3 k) U% l文本框的默认值 9 J8 O3 ^8 a) i; j( m8 { S
<input type=text value="123" >2 v5 I+ h# q1 w7 |4 [8 ^) A1 a7 J
title换行 : K0 |- l6 Q9 A" L
obj.title = "123 sdfs "
3 {$ f" u4 `' p' E# c5 n# w% M获得时间所代表的微秒 4 |1 ?* d) {+ t. W4 P* {1 n) n6 ]
var n1 = new Date("2004-10-10".replace(/-/g, "\/")).getTime()
( p6 u3 n* W( Z5 b窗口是否关闭
" N+ Z1 B. c s0 L* Ewin.closed3 S% ~6 N1 b9 c8 z- X# u
" X& \! B+ j& H3 q3 p/ E9 `3 ~" N2 n
checkbox扁平
$ S8 z5 W! P( c. P5 F<input type=checkbox style="position: absolute; clip:rect(5px 15px 15px 5px)"><br>
: e( U! b% ]; _% Y' [% a8 P获取选中内容
4 h! F# l0 v# K& z1 x9 sdocument.selection.createRange().duplicate().text" F% j4 Y( E0 P0 t+ B1 J1 }) T" t% h
自动完成功能
$ h/ P, ?% ?% [( R, X<input type=text autocomplete=on>打开该功能
9 S, _! G' y% Z) Y9 h<input type=text autocomplete=off>关闭该功能+ L( P: e% x, ~# P4 n
关闭窗口. [' i0 n& s2 K7 [/ F' |' ^/ `2 _( F
window.close();4 ?6 R, t" K$ C, o
返回9 u; M0 d( i) k' a3 P
history.back();7 j8 S9 Q# J- U& |1 C3 C$ b, X
无关闭按钮IE window.open("aa.htm", "meizz", "fullscreen=7"); w0 l5 W. q7 L; a2 P8 @; O6 ?. m1 n
统一编码/解码 alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= hehe"))) / y3 G3 u7 Y) X
encodeURIComponent对":"、"/"、";" 和 "?"也编码
+ d. y A1 v5 q. p& A
! c; s1 X! p! L, z( L" ]+ Q' d" ]8 r M
6 Z* S1 m, Y1 D! \
|
zan
|