-
Notifications
You must be signed in to change notification settings - Fork 1
/
[api][bom]浏览器window对象的属性与方法.html
333 lines (330 loc) · 77.9 KB
/
[api][bom]浏览器window对象的属性与方法.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>浏览器window对象的属性与方法 | JyLie</title>
<meta name="generator" content="VuePress 1.5.0">
<link rel="icon" href="/idea-domain/favicon.ico">
<meta name="description" content="Code my dream!">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<link rel="preload" href="/idea-domain/assets/css/0.styles.2c36a006.css" as="style"><link rel="preload" href="/idea-domain/assets/js/app.89376c8e.js" as="script"><link rel="preload" href="/idea-domain/assets/js/4.5465c98c.js" as="script"><link rel="preload" href="/idea-domain/assets/js/1.4d4f02de.js" as="script"><link rel="preload" href="/idea-domain/assets/js/23.1fbc2526.js" as="script"><link rel="prefetch" href="/idea-domain/assets/js/10.a2352b9f.js"><link rel="prefetch" href="/idea-domain/assets/js/11.c25da6a4.js"><link rel="prefetch" href="/idea-domain/assets/js/12.4b9a78a0.js"><link rel="prefetch" href="/idea-domain/assets/js/13.4baadb5a.js"><link rel="prefetch" href="/idea-domain/assets/js/14.185a9a02.js"><link rel="prefetch" href="/idea-domain/assets/js/15.9636a8ca.js"><link rel="prefetch" href="/idea-domain/assets/js/16.679932b8.js"><link rel="prefetch" href="/idea-domain/assets/js/17.dd32ab06.js"><link rel="prefetch" href="/idea-domain/assets/js/18.32b1cf56.js"><link rel="prefetch" href="/idea-domain/assets/js/19.a56920af.js"><link rel="prefetch" href="/idea-domain/assets/js/20.438036b2.js"><link rel="prefetch" href="/idea-domain/assets/js/21.16413d4b.js"><link rel="prefetch" href="/idea-domain/assets/js/22.0e53dc4f.js"><link rel="prefetch" href="/idea-domain/assets/js/24.84de9b18.js"><link rel="prefetch" href="/idea-domain/assets/js/25.d8f5fb42.js"><link rel="prefetch" href="/idea-domain/assets/js/26.08b284c3.js"><link rel="prefetch" href="/idea-domain/assets/js/27.fc88097b.js"><link rel="prefetch" href="/idea-domain/assets/js/28.0e86cd67.js"><link rel="prefetch" href="/idea-domain/assets/js/29.14a3a251.js"><link rel="prefetch" href="/idea-domain/assets/js/30.380fd044.js"><link rel="prefetch" href="/idea-domain/assets/js/31.2159b398.js"><link rel="prefetch" href="/idea-domain/assets/js/32.9fd1bac0.js"><link rel="prefetch" href="/idea-domain/assets/js/33.66deed1e.js"><link rel="prefetch" href="/idea-domain/assets/js/34.660bbe89.js"><link rel="prefetch" href="/idea-domain/assets/js/35.d6613fc9.js"><link rel="prefetch" href="/idea-domain/assets/js/36.5debaab7.js"><link rel="prefetch" href="/idea-domain/assets/js/37.baea05f8.js"><link rel="prefetch" href="/idea-domain/assets/js/38.b12b93d9.js"><link rel="prefetch" href="/idea-domain/assets/js/39.881b30e0.js"><link rel="prefetch" href="/idea-domain/assets/js/40.c5906ef8.js"><link rel="prefetch" href="/idea-domain/assets/js/41.314b3f1d.js"><link rel="prefetch" href="/idea-domain/assets/js/42.b3e6177b.js"><link rel="prefetch" href="/idea-domain/assets/js/43.05e57135.js"><link rel="prefetch" href="/idea-domain/assets/js/44.decce320.js"><link rel="prefetch" href="/idea-domain/assets/js/45.92f9fb7a.js"><link rel="prefetch" href="/idea-domain/assets/js/46.d9fd684f.js"><link rel="prefetch" href="/idea-domain/assets/js/47.46b7b146.js"><link rel="prefetch" href="/idea-domain/assets/js/48.4ac11cbd.js"><link rel="prefetch" href="/idea-domain/assets/js/49.73378ba2.js"><link rel="prefetch" href="/idea-domain/assets/js/5.0b75201a.js"><link rel="prefetch" href="/idea-domain/assets/js/50.1a6b9738.js"><link rel="prefetch" href="/idea-domain/assets/js/51.70dbe9ec.js"><link rel="prefetch" href="/idea-domain/assets/js/52.1743641c.js"><link rel="prefetch" href="/idea-domain/assets/js/53.88c57e85.js"><link rel="prefetch" href="/idea-domain/assets/js/54.8df6ccd2.js"><link rel="prefetch" href="/idea-domain/assets/js/55.7958b607.js"><link rel="prefetch" href="/idea-domain/assets/js/56.cfd57e97.js"><link rel="prefetch" href="/idea-domain/assets/js/57.156cd233.js"><link rel="prefetch" href="/idea-domain/assets/js/58.197d2a8c.js"><link rel="prefetch" href="/idea-domain/assets/js/59.d7a72db1.js"><link rel="prefetch" href="/idea-domain/assets/js/6.1d6b63a7.js"><link rel="prefetch" href="/idea-domain/assets/js/60.c62a4d78.js"><link rel="prefetch" href="/idea-domain/assets/js/61.949370dd.js"><link rel="prefetch" href="/idea-domain/assets/js/62.23a941cc.js"><link rel="prefetch" href="/idea-domain/assets/js/63.65d4a7fe.js"><link rel="prefetch" href="/idea-domain/assets/js/64.7ac5ce1f.js"><link rel="prefetch" href="/idea-domain/assets/js/65.06b31195.js"><link rel="prefetch" href="/idea-domain/assets/js/66.0502d679.js"><link rel="prefetch" href="/idea-domain/assets/js/67.8933a0d7.js"><link rel="prefetch" href="/idea-domain/assets/js/68.b5952168.js"><link rel="prefetch" href="/idea-domain/assets/js/69.5e2c7b6f.js"><link rel="prefetch" href="/idea-domain/assets/js/7.915bfa51.js"><link rel="prefetch" href="/idea-domain/assets/js/70.b1e5fa24.js"><link rel="prefetch" href="/idea-domain/assets/js/71.1f97cb34.js"><link rel="prefetch" href="/idea-domain/assets/js/72.de33eb9f.js"><link rel="prefetch" href="/idea-domain/assets/js/73.b6026198.js"><link rel="prefetch" href="/idea-domain/assets/js/74.36040e8e.js"><link rel="prefetch" href="/idea-domain/assets/js/75.b1ee04bd.js"><link rel="prefetch" href="/idea-domain/assets/js/76.674f3bcb.js"><link rel="prefetch" href="/idea-domain/assets/js/77.2e8d78eb.js"><link rel="prefetch" href="/idea-domain/assets/js/78.6be64fef.js"><link rel="prefetch" href="/idea-domain/assets/js/79.9b118866.js"><link rel="prefetch" href="/idea-domain/assets/js/8.189eb478.js"><link rel="prefetch" href="/idea-domain/assets/js/80.85bb9d6a.js"><link rel="prefetch" href="/idea-domain/assets/js/81.0dab5b76.js"><link rel="prefetch" href="/idea-domain/assets/js/82.428c38c7.js"><link rel="prefetch" href="/idea-domain/assets/js/83.d4455b9e.js"><link rel="prefetch" href="/idea-domain/assets/js/84.02a939e7.js"><link rel="prefetch" href="/idea-domain/assets/js/85.ed694f58.js"><link rel="prefetch" href="/idea-domain/assets/js/86.eeda91b2.js"><link rel="prefetch" href="/idea-domain/assets/js/87.afb850a1.js"><link rel="prefetch" href="/idea-domain/assets/js/9.db2c446c.js"><link rel="prefetch" href="/idea-domain/assets/js/vendors~flowchart.567eafbc.js">
<link rel="stylesheet" href="/idea-domain/assets/css/0.styles.2c36a006.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container" data-v-5f3f4765><div data-v-5f3f4765><div id="loader-wrapper" class="loading-wrapper" data-v-164600bd data-v-5f3f4765 data-v-5f3f4765><div class="loader-main" data-v-164600bd><div data-v-164600bd></div><div data-v-164600bd></div><div data-v-164600bd></div><div data-v-164600bd></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-7c5ab02c data-v-5f3f4765 data-v-5f3f4765><h3 class="title" style="display:none;" data-v-7c5ab02c data-v-7c5ab02c>JyLie</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-7c5ab02c data-v-7c5ab02c><input type="password" value="" data-v-7c5ab02c> <span data-v-7c5ab02c>Konck! Knock!</span> <button data-v-7c5ab02c>OK</button></label> <div class="footer" style="display:none;" data-v-7c5ab02c data-v-7c5ab02c><span data-v-7c5ab02c><i class="iconfont reco-theme" data-v-7c5ab02c></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-7c5ab02c>vuePress-theme-reco</a></span> <span data-v-7c5ab02c><i class="iconfont reco-copyright" data-v-7c5ab02c></i> <a data-v-7c5ab02c><span data-v-7c5ab02c>JyLie</span>
<span data-v-7c5ab02c>2017 - </span>
2023
</a></span></div></div> <div class="hide" data-v-5f3f4765><header class="navbar" data-v-5f3f4765><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/idea-domain/" class="home-link router-link-active"><!----> <span class="site-name">JyLie</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/idea-domain/" class="nav-link"><i class="iconfont reco-home"></i>
主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
分类
</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/idea-domain/categories/API/" class="nav-link"><i class="iconfont undefined"></i>
API
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/HTML/" class="nav-link"><i class="iconfont undefined"></i>
HTML
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/css/" class="nav-link"><i class="iconfont undefined"></i>
css
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/vue/" class="nav-link"><i class="iconfont undefined"></i>
vue
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Linux/" class="nav-link"><i class="iconfont undefined"></i>
Linux
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Docker/" class="nav-link"><i class="iconfont undefined"></i>
Docker
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Webpack/" class="nav-link"><i class="iconfont undefined"></i>
Webpack
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/WebGL/" class="nav-link"><i class="iconfont undefined"></i>
WebGL
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/PixiJS/" class="nav-link"><i class="iconfont undefined"></i>
PixiJS
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Github/" class="nav-link"><i class="iconfont undefined"></i>
Github
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/BOM/" class="nav-link"><i class="iconfont undefined"></i>
BOM
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/XML/" class="nav-link"><i class="iconfont undefined"></i>
XML
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/bug/" class="nav-link"><i class="iconfont undefined"></i>
bug
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/ie/" class="nav-link"><i class="iconfont undefined"></i>
ie
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/uniapp/" class="nav-link"><i class="iconfont undefined"></i>
uniapp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/IE/" class="nav-link"><i class="iconfont undefined"></i>
IE
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/mysql/" class="nav-link"><i class="iconfont undefined"></i>
mysql
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/font/" class="nav-link"><i class="iconfont undefined"></i>
font
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/bom/" class="nav-link"><i class="iconfont undefined"></i>
bom
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/canvas/" class="nav-link"><i class="iconfont undefined"></i>
canvas
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/video/" class="nav-link"><i class="iconfont undefined"></i>
video
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/html/" class="nav-link"><i class="iconfont undefined"></i>
html
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/JavaScript/" class="nav-link"><i class="iconfont undefined"></i>
JavaScript
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/js/" class="nav-link"><i class="iconfont undefined"></i>
js
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/运算符/" class="nav-link"><i class="iconfont undefined"></i>
运算符
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/RegExp/" class="nav-link"><i class="iconfont undefined"></i>
RegExp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/编码/" class="nav-link"><i class="iconfont undefined"></i>
编码
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/MiniApp/" class="nav-link"><i class="iconfont undefined"></i>
MiniApp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/nginx/" class="nav-link"><i class="iconfont undefined"></i>
nginx
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Tool/" class="nav-link"><i class="iconfont undefined"></i>
Tool
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/node.js/" class="nav-link"><i class="iconfont undefined"></i>
node.js
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/cat/" class="nav-link"><i class="iconfont undefined"></i>
cat
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/nodejs/" class="nav-link"><i class="iconfont undefined"></i>
nodejs
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/protocol/" class="nav-link"><i class="iconfont undefined"></i>
protocol
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/URL/" class="nav-link"><i class="iconfont undefined"></i>
URL
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/FLOW/" class="nav-link"><i class="iconfont undefined"></i>
FLOW
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/DNS/" class="nav-link"><i class="iconfont undefined"></i>
DNS
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Protocol/" class="nav-link"><i class="iconfont undefined"></i>
Protocol
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/python/" class="nav-link"><i class="iconfont undefined"></i>
python
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/安全/" class="nav-link"><i class="iconfont undefined"></i>
安全
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/linux/" class="nav-link"><i class="iconfont undefined"></i>
linux
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/shell/" class="nav-link"><i class="iconfont undefined"></i>
shell
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/IDE/" class="nav-link"><i class="iconfont undefined"></i>
IDE
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Packer/" class="nav-link"><i class="iconfont undefined"></i>
Packer
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/ViteJS/" class="nav-link"><i class="iconfont undefined"></i>
ViteJS
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/git/" class="nav-link"><i class="iconfont undefined"></i>
git
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/vendor/" class="nav-link"><i class="iconfont undefined"></i>
vendor
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/WebApp/" class="nav-link"><i class="iconfont undefined"></i>
WebApp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/WebView/" class="nav-link"><i class="iconfont undefined"></i>
WebView
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Window API/" class="nav-link"><i class="iconfont undefined"></i>
Window API
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/webview/" class="nav-link"><i class="iconfont undefined"></i>
webview
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/规范/" class="nav-link"><i class="iconfont undefined"></i>
规范
</a></li></ul></div></div><div class="nav-item"><a href="/idea-domain/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
标签
</a></div><div class="nav-item"><a href="/idea-domain/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
时光轴
</a></div><div class="nav-item"><a href="https://github.com/liejiayong" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
GitHub
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-5f3f4765></div> <aside class="sidebar" data-v-5f3f4765><div class="personal-info-wrapper" data-v-a30e08ee><img src="/idea-domain/avatar.jpg" alt="author-avatar" class="personal-img" data-v-a30e08ee> <h3 class="name" data-v-a30e08ee>
JyLie
</h3> <div class="num" data-v-a30e08ee><div data-v-a30e08ee><h3 data-v-a30e08ee>74</h3> <h6 data-v-a30e08ee>Article</h6></div> <div data-v-a30e08ee><h3 data-v-a30e08ee>79</h3> <h6 data-v-a30e08ee>Tag</h6></div></div> <hr data-v-a30e08ee></div> <nav class="nav-links"><div class="nav-item"><a href="/idea-domain/" class="nav-link"><i class="iconfont reco-home"></i>
主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
分类
</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/idea-domain/categories/API/" class="nav-link"><i class="iconfont undefined"></i>
API
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/HTML/" class="nav-link"><i class="iconfont undefined"></i>
HTML
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/css/" class="nav-link"><i class="iconfont undefined"></i>
css
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/vue/" class="nav-link"><i class="iconfont undefined"></i>
vue
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Linux/" class="nav-link"><i class="iconfont undefined"></i>
Linux
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Docker/" class="nav-link"><i class="iconfont undefined"></i>
Docker
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Webpack/" class="nav-link"><i class="iconfont undefined"></i>
Webpack
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/WebGL/" class="nav-link"><i class="iconfont undefined"></i>
WebGL
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/PixiJS/" class="nav-link"><i class="iconfont undefined"></i>
PixiJS
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Github/" class="nav-link"><i class="iconfont undefined"></i>
Github
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/BOM/" class="nav-link"><i class="iconfont undefined"></i>
BOM
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/XML/" class="nav-link"><i class="iconfont undefined"></i>
XML
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/bug/" class="nav-link"><i class="iconfont undefined"></i>
bug
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/ie/" class="nav-link"><i class="iconfont undefined"></i>
ie
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/uniapp/" class="nav-link"><i class="iconfont undefined"></i>
uniapp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/IE/" class="nav-link"><i class="iconfont undefined"></i>
IE
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/mysql/" class="nav-link"><i class="iconfont undefined"></i>
mysql
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/font/" class="nav-link"><i class="iconfont undefined"></i>
font
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/bom/" class="nav-link"><i class="iconfont undefined"></i>
bom
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/canvas/" class="nav-link"><i class="iconfont undefined"></i>
canvas
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/video/" class="nav-link"><i class="iconfont undefined"></i>
video
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/html/" class="nav-link"><i class="iconfont undefined"></i>
html
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/JavaScript/" class="nav-link"><i class="iconfont undefined"></i>
JavaScript
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/js/" class="nav-link"><i class="iconfont undefined"></i>
js
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/运算符/" class="nav-link"><i class="iconfont undefined"></i>
运算符
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/RegExp/" class="nav-link"><i class="iconfont undefined"></i>
RegExp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/编码/" class="nav-link"><i class="iconfont undefined"></i>
编码
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/MiniApp/" class="nav-link"><i class="iconfont undefined"></i>
MiniApp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/nginx/" class="nav-link"><i class="iconfont undefined"></i>
nginx
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Tool/" class="nav-link"><i class="iconfont undefined"></i>
Tool
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/node.js/" class="nav-link"><i class="iconfont undefined"></i>
node.js
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/cat/" class="nav-link"><i class="iconfont undefined"></i>
cat
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/nodejs/" class="nav-link"><i class="iconfont undefined"></i>
nodejs
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/protocol/" class="nav-link"><i class="iconfont undefined"></i>
protocol
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/URL/" class="nav-link"><i class="iconfont undefined"></i>
URL
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/FLOW/" class="nav-link"><i class="iconfont undefined"></i>
FLOW
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/DNS/" class="nav-link"><i class="iconfont undefined"></i>
DNS
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Protocol/" class="nav-link"><i class="iconfont undefined"></i>
Protocol
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/python/" class="nav-link"><i class="iconfont undefined"></i>
python
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/安全/" class="nav-link"><i class="iconfont undefined"></i>
安全
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/linux/" class="nav-link"><i class="iconfont undefined"></i>
linux
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/shell/" class="nav-link"><i class="iconfont undefined"></i>
shell
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/IDE/" class="nav-link"><i class="iconfont undefined"></i>
IDE
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Packer/" class="nav-link"><i class="iconfont undefined"></i>
Packer
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/ViteJS/" class="nav-link"><i class="iconfont undefined"></i>
ViteJS
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/git/" class="nav-link"><i class="iconfont undefined"></i>
git
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/vendor/" class="nav-link"><i class="iconfont undefined"></i>
vendor
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/WebApp/" class="nav-link"><i class="iconfont undefined"></i>
WebApp
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/WebView/" class="nav-link"><i class="iconfont undefined"></i>
WebView
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/Window API/" class="nav-link"><i class="iconfont undefined"></i>
Window API
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/webview/" class="nav-link"><i class="iconfont undefined"></i>
webview
</a></li><li class="dropdown-item"><!----> <a href="/idea-domain/categories/规范/" class="nav-link"><i class="iconfont undefined"></i>
规范
</a></li></ul></div></div><div class="nav-item"><a href="/idea-domain/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
标签
</a></div><div class="nav-item"><a href="/idea-domain/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
时光轴
</a></div><div class="nav-item"><a href="https://github.com/liejiayong" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
GitHub
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>浏览器window对象的属性与方法</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-getcomputedstyle-element-pseudoelt" class="sidebar-link">window.getComputedStyle(element, [pseudoElt]);</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-getselection" class="sidebar-link">window.getSelection()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-open-url-name-specs-replace" class="sidebar-link">window.open([url],[name],[specs],[replace])</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-requestanimationframe-callback" class="sidebar-link">window.requestAnimationFrame(callback)</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-print" class="sidebar-link">window.print()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-close" class="sidebar-link">window.close()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-blur" class="sidebar-link">window.blur()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-focus" class="sidebar-link">window.focus()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-scroll" class="sidebar-link">window.scroll()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-scrollto" class="sidebar-link">window.scrollTo()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-moveby-deltax-deltay-、window-moveto-x-y-、window-resizeby-xdelta-ydelta-跳转窗口大小" class="sidebar-link">window.moveBy(deltaX, deltaY) 、window.moveTo(x, y)、window.resizeBy(xDelta, yDelta) 跳转窗口大小</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-postmessage" class="sidebar-link">window.postMessage()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-stop" class="sidebar-link">window.stop()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-alert-string" class="sidebar-link">window.alert(string)</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-confirm-string" class="sidebar-link">window.confirm(string)</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-prompt-string-defaulttext" class="sidebar-link">window.prompt([string],[defaultText])</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-settimeout-function-milliseconds-param1-param2" class="sidebar-link">window.setTimeout(function, milliseconds, [param1], [param2], [...])</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-cleartimeout-id-of-settimeout" class="sidebar-link">window.clearTimeout(idofsettimeout)</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-setinterval-function-milliseconds-param1-param2" class="sidebar-link">window.setInterval(function, milliseconds, [param1], [param2], [...])</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-clearinterval-id-of-setinterval" class="sidebar-link">window.clearInterval(idofsetinterval)</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-find-astring-acasesensitive-abackwards-awraparound-awholeword-asearchinframes-ashowdialog" class="sidebar-link">window.find(aString, aCaseSensitive, aBackwards, aWrapAround, aWholeWord, aSearchInFrames, aShowDialog);</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-matchmedia" class="sidebar-link">window.matchMedia()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-getdefaultcomputedstyle" class="sidebar-link">window.getDefaultComputedStyle()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-back" class="sidebar-link">window.back()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-forward" class="sidebar-link">window.forward()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-home" class="sidebar-link">window.home()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-dump-string" class="sidebar-link">window.dump(string)</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-captureevents" class="sidebar-link">window.captureEvents()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-dispatchevent" class="sidebar-link">window.dispatchEvent()</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-closed" class="sidebar-link">window.closed</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-console" class="sidebar-link">window.console</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-crypto" class="sidebar-link">window.crypto</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-devicepixelratio" class="sidebar-link">window.devicePixelRatio</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-document" class="sidebar-link">window.document</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-frameelement" class="sidebar-link">window.frameElement</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-frames" class="sidebar-link">window.frames</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-history" class="sidebar-link">window.history</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-location" class="sidebar-link">window.location</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#浏览器仓库" class="sidebar-link">浏览器仓库</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-navigator" class="sidebar-link">window.navigator</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-length" class="sidebar-link">window.length</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-name" class="sidebar-link">window.name</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-screen" class="sidebar-link">window.screen</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-menubar" class="sidebar-link">window.menubar</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-personalbar" class="sidebar-link">window.personalbar</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/idea-domain/post/%5Bapi%5D%5Bbom%5D%E6%B5%8F%E8%A7%88%E5%99%A8window%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%B1%9E%E6%80%A7%E4%B8%8E%E6%96%B9%E6%B3%95.html#window-scrollbars" class="sidebar-link">window.scrollbars</a><ul class="sidebar-sub-headers"></ul></li></ul></section></li></ul> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-7c5ab02c data-v-5f3f4765><h3 class="title" style="display:none;" data-v-7c5ab02c data-v-7c5ab02c>浏览器window对象的属性与方法</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-7c5ab02c data-v-7c5ab02c><input type="password" value="" data-v-7c5ab02c> <span data-v-7c5ab02c>Konck! Knock!</span> <button data-v-7c5ab02c>OK</button></label> <div class="footer" style="display:none;" data-v-7c5ab02c data-v-7c5ab02c><span data-v-7c5ab02c><i class="iconfont reco-theme" data-v-7c5ab02c></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-7c5ab02c>vuePress-theme-reco</a></span> <span data-v-7c5ab02c><i class="iconfont reco-copyright" data-v-7c5ab02c></i> <a data-v-7c5ab02c><span data-v-7c5ab02c>JyLie</span>
<span data-v-7c5ab02c>2017 - </span>
2023
</a></span></div></div> <div data-v-5f3f4765><main class="page"><div class="page-title" style="display:none;"><h1>浏览器window对象的属性与方法</h1> <hr> <div data-v-2c863f0e><i class="iconfont reco-account" data-v-2c863f0e><span data-v-2c863f0e>JyLie</span></i> <i class="iconfont reco-date" data-v-2c863f0e><span data-v-2c863f0e>2017-06-12</span></i> <!----> <i class="iconfont reco-tag tags" data-v-2c863f0e><span class="tag-item" data-v-2c863f0e>API</span><span class="tag-item" data-v-2c863f0e>BOM</span></i></div></div> <div class="theme-reco-content content__default" style="display:none;"><h1 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h1> <p><code>window 对象</code> 是客户端 JavaScript 脚步的顶层对象之一,只要打开浏览器窗口,不管该窗口中是否有打开的网页,当存在 <code>BODY、FRAMESET、FRAME、iframe</code> 元素时,浏览器都会自动建立 window 对象的实例。</p> <p>此外,<code>window 对象</code>的实例也可由 <code>window.open()</code> 方法动态创建。</p> <p>由于 <code>window 对象</code> 是其它大部分对象的共同祖先,在调用 <code>window 对象</code>的方法和属性时,可以省略 window 对象的引用。</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>window<span class="token punctuation">.</span>document<span class="token punctuation">.</span><span class="token function">write</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token comment">// 可简写为</span>
document<span class="token punctuation">.</span><span class="token function">write</span><span class="token punctuation">(</span><span class="token punctuation">)</span>。
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p>在窗口中觖发本窗口对象的任何方法和属性时可以省去窗口的实例名称。</p> <p>例如给当前的 myWin 窗口设置 status 属性时,可以只用 status 而不用 myWin.status。</p> <p>但是,在事件处理中调用 location 属性、close()方法或 open()方法时必须使用实例名称。</p> <p>下面会记录常用 window 的属性和方法</p> <h1 id="window-对象常用方法"><a href="#window-对象常用方法" class="header-anchor">#</a> window 对象常用方法</h1> <h2 id="window-getcomputedstyle-element-pseudoelt"><a href="#window-getcomputedstyle-element-pseudoelt" class="header-anchor">#</a> window.getComputedStyle(element, [pseudoElt]);</h2> <p>返回一个对象,该对象在应用活动样式表并解析这些值可能包含的任何基本计算后报告元素的所有 CSS 属性的值。</p> <ul><li>pseudoElt 指定一个要匹配的伪元素的字符串。必须对普通元素省略(或 null)</li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> elem1 <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">'elemId'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">let</span> style <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">getComputedStyle</span><span class="token punctuation">(</span>elem1<span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 它等价于</span>
<span class="token keyword">let</span> style <span class="token operator">=</span> document<span class="token punctuation">.</span>defaultView<span class="token punctuation">.</span><span class="token function">getComputedStyle</span><span class="token punctuation">(</span>elem1<span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="window-getselection"><a href="#window-getselection" class="header-anchor">#</a> window.getSelection()</h2> <p>返回一个 Selection 对象,表示用户选择的文本范围或光标的当前位置。</p> <p>如果想要将 selection 转换为字符串,可通过连接一个空字符串("")或使用 String.toString() 方法。</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> selObj <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">getSelection</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>selObj<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> selectedText <span class="token operator">=</span> selObj<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>selectedText<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="window-open-url-name-specs-replace"><a href="#window-open-url-name-specs-replace" class="header-anchor">#</a> window.open([url],[name],[specs],[replace])</h2> <p>用于打开一个新的浏览器窗口或查找一个已命名的窗口。</p> <ul><li><p>语法格式:window.open(URL, 窗口名称, 窗口风格,新增或替换浏览历史)</p></li> <li><p>小技巧:该方法经常用于在打开一个网页时自动打开另一个窗口。</p></li> <li><p>specs 风格参数说明:</p> <ul><li>channelmode=yes|no|1|0 是否要在影院模式显示 window。默认是没有的。仅限 IE 浏览器</li> <li>directories=yes|no|1|0 是否添加目录按钮。默认是肯定的。仅限 IE 浏览器</li> <li>fullscreen=yes|no|1|0 浏览器是否显示全屏模式。默认是没有的。在全屏模式下的 window,还必须在影院模式。仅限 IE 浏览器</li> <li>height=pixels 窗口的高度。最小.值为 100</li> <li>left=pixels 该窗口的左侧位置</li> <li>location=yes|no|1|0 是否显示地址字段.默认值是 yes</li> <li>menubar=yes|no|1|0 是否显示菜单栏.默认值是 yes</li> <li>resizable=yes|no|1|0 是否可调整窗口大小.默认值是 yes</li> <li>scrollbars=yes|no|1|0 是否显示滚动条.默认值是 yes</li> <li>status=yes|no|1|0 是否要添加一个状态栏.默认值是 yes</li> <li>titlebar=yes|no|1|0 是否显示标题栏.被忽略,除非调用 HTML 应用程序或一个值得信赖的对话框.默认值是 yes</li> <li>toolbar=yes|no|1|0 是否显示浏览器工具栏.默认值是 yes</li> <li>top=pixels 窗口顶部的位置.仅限 IE 浏览器</li> <li>width=pixels 窗口的宽度.最小.值为 100</li></ul></li> <li><p>注意事项</p></li></ul> <p>为了避免 window.open 后暴露窗口句柄,从而因此不必要的危险,建议在创建 window 实例后将 opener 置空</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">/**
* 打开一个窗口
* @param { string } url
* @param { string } windowName
* @param { number } width
* @param { number } height
*/</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">openWindow</span><span class="token punctuation">(</span><span class="token parameter">url<span class="token punctuation">,</span> windowName<span class="token punctuation">,</span> width<span class="token punctuation">,</span> height</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">var</span> x <span class="token operator">=</span> <span class="token function">parseInt</span><span class="token punctuation">(</span>screen<span class="token punctuation">.</span>width <span class="token operator">/</span> <span class="token number">2.0</span><span class="token punctuation">)</span> <span class="token operator">-</span> width <span class="token operator">/</span> <span class="token number">2.0</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> y <span class="token operator">=</span> <span class="token function">parseInt</span><span class="token punctuation">(</span>screen<span class="token punctuation">.</span>height <span class="token operator">/</span> <span class="token number">2.0</span><span class="token punctuation">)</span> <span class="token operator">-</span> height <span class="token operator">/</span> <span class="token number">2.0</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> isMSIE <span class="token operator">=</span> navigator<span class="token punctuation">.</span>appName <span class="token operator">==</span> <span class="token string">'Microsoft Internet Explorer'</span><span class="token punctuation">;</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span>isMSIE<span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">var</span> p <span class="token operator">=</span> <span class="token string">'resizable=1,location=no,scrollbars=no,width='</span><span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> width<span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> <span class="token string">',height='</span><span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> height<span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> <span class="token string">',left='</span><span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> x<span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> <span class="token string">',top='</span><span class="token punctuation">;</span>
p <span class="token operator">=</span> p <span class="token operator">+</span> y<span class="token punctuation">;</span>
window<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span>url<span class="token punctuation">,</span> windowName<span class="token punctuation">,</span> p<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
<span class="token keyword">var</span> win <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span>
url<span class="token punctuation">,</span>
windowName<span class="token punctuation">,</span>
<span class="token string">'top='</span> <span class="token operator">+</span>
y <span class="token operator">+</span>
<span class="token string">',left='</span> <span class="token operator">+</span>
x <span class="token operator">+</span>
<span class="token string">',scrollbars='</span> <span class="token operator">+</span>
scrollbars <span class="token operator">+</span>
<span class="token string">',dialog=yes,modal=yes,width='</span> <span class="token operator">+</span>
width <span class="token operator">+</span>
<span class="token string">',height='</span> <span class="token operator">+</span>
height <span class="token operator">+</span>
<span class="token string">',resizable=no'</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">eval</span><span class="token punctuation">(</span><span class="token string">'try { win.resizeTo(width, height); } catch(e) { }'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
win<span class="token punctuation">.</span><span class="token function">focus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
win<span class="token punctuation">.</span>opener <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br></div></div><h2 id="window-requestanimationframe-callback"><a href="#window-requestanimationframe-callback" class="header-anchor">#</a> window.requestAnimationFrame(callback)</h2> <p>一般用户绘制 canvas 动画。让浏览器在下次重绘之前调用指定的回调函数更新动画。</p> <p>回调函数执行次数通常是每秒 60 次,但在大多数遵循 W3C 建议的浏览器中,回调函数执行次数通常与浏览器屏幕刷新次数相匹配。</p> <h2 id="window-print"><a href="#window-print" class="header-anchor">#</a> window.print()</h2> <p>打开打印对话框打印当前文档.</p> <h2 id="window-close"><a href="#window-close" class="header-anchor">#</a> window.close()</h2> <p>用于关闭浏览器窗口。</p> <h2 id="window-blur"><a href="#window-blur" class="header-anchor">#</a> window.blur()</h2> <p>将焦点移出顶层窗口。</p> <p>当与 focus 方法合用时必须小心,因为可能导致焦点不断移进移出。</p> <h2 id="window-focus"><a href="#window-focus" class="header-anchor">#</a> window.focus()</h2> <p>功能:使窗口中得到焦点。</p> <p>当与 blur 方法合用时必须小心,因为可能导致焦点不断移进移出。</p> <h2 id="window-scroll"><a href="#window-scroll" class="header-anchor">#</a> window.scroll()</h2> <p>滚动窗口至文档中的特定位置。</p> <ul><li>window.scroll(x-coord, y-coord)</li> <li>window.scroll(options)</li></ul> <p>window.scrollTo 实际上和该方法是相同的。</p> <p>想要重复地滚动某个距离,请使用 window.scrollBy。</p> <h2 id="window-scrollto"><a href="#window-scrollto" class="header-anchor">#</a> window.scrollTo()</h2> <p>滚动到文档中的某个坐标。</p> <ul><li>window.scrollTo(x-coord,y-coord )</li> <li>window.scrollTo(options)</li></ul> <h2 id="window-moveby-deltax-deltay-、window-moveto-x-y-、window-resizeby-xdelta-ydelta-跳转窗口大小"><a href="#window-moveby-deltax-deltay-、window-moveto-x-y-、window-resizeby-xdelta-ydelta-跳转窗口大小" class="header-anchor">#</a> window.moveBy(deltaX, deltaY) 、window.moveTo(x, y)、window.resizeBy(xDelta, yDelta) 跳转窗口大小</h2> <p>根据指定的值,移动当前窗口。</p> <ul><li>注意事项</li></ul> <p>从 Firefox 7 开始,依据下面的规则,不能再移动一个浏览器里的窗口。</p> <ul><li>不能移动非 window.open 创建的窗口或 Tab。</li> <li>当一个窗口里有多于一个 Tab 时,不能移动该窗口。</li></ul> <h2 id="window-postmessage"><a href="#window-postmessage" class="header-anchor">#</a> window.postMessage()</h2> <p>可以安全地实现跨源通信。</p> <p>通常,对于两个不同页面的脚本,只有当执行它们的页面位于具有相同的协议(通常为 https),端口号(443 为 https 的默认值),以及主机 (两个页面的模数 Document.domain 设置为相同的值) 时,这两个脚本才能相互通信。</p> <h2 id="window-stop"><a href="#window-stop" class="header-anchor">#</a> window.stop()</h2> <p>效果相当于点击了浏览器的停止按钮。</p> <p>由于脚本的加载顺序,该方法不能阻止已经包含在加载中的文档,但是它能够阻止图片、新窗口、和一些会延迟加载的对象的加载。</p> <h2 id="window-alert-string"><a href="#window-alert-string" class="header-anchor">#</a> window.alert(string)</h2> <p>用于显示带有一条指定消息和一个 确认 按钮的警告框</p> <h2 id="window-confirm-string"><a href="#window-confirm-string" class="header-anchor">#</a> window.confirm(string)</h2> <p>用于显示一个带有指定消息和确认及取消按钮的对话框。</p> <p>如果访问者点击"确定",此方法返回 true,否则返回 false。</p> <p>返回 boolean 类型</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">var</span> isRead <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">confirm</span><span class="token punctuation">(</span><span class="token string">'是否阅读?'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
isRead <span class="token operator">?</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'Yes'</span><span class="token punctuation">)</span> <span class="token operator">:</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'No'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h2 id="window-prompt-string-defaulttext"><a href="#window-prompt-string-defaulttext" class="header-anchor">#</a> window.prompt([string],[defaultText])</h2> <p>用于显示可提示用户进行输入的对话框。</p> <p>当用户单击“确定”按钮时,返回用户输入的字符串,</p> <p>当单击“取消”按钮时,返回 null 值。</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">var</span> isRead <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">prompt</span><span class="token punctuation">(</span><span class="token string">'是否阅读?'</span><span class="token punctuation">,</span> <span class="token string">'已确定'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>isRead<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h2 id="window-settimeout-function-milliseconds-param1-param2"><a href="#window-settimeout-function-milliseconds-param1-param2" class="header-anchor">#</a> window.setTimeout(function, milliseconds, [param1], [param2], [...])</h2> <p>setTimeout() 方法用于在指定的毫秒数后调用函数或计算表达式。</p> <p>返回一个 ID 句柄</p> <ul><li>温馨提示:
<ul><li>1000 毫秒= 1 秒。</li> <li>param 为传给执行函数的其他参数,且 ie10+开始支持</li></ul></li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token function">setTimeout</span><span class="token punctuation">(</span>
<span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter"><span class="token operator">...</span>params</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">input params: </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>params<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token number">1000</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'JyLie'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token number">18</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="window-cleartimeout-id-of-settimeout"><a href="#window-cleartimeout-id-of-settimeout" class="header-anchor">#</a> window.clearTimeout(id_of_settimeout)</h2> <p>取消由 setTimeout() 方法设置的定时操作</p> <h2 id="window-setinterval-function-milliseconds-param1-param2"><a href="#window-setinterval-function-milliseconds-param1-param2" class="header-anchor">#</a> window.setInterval(function, milliseconds, [param1], [param2], [...])</h2> <p>使用方法与 setTimeout 相似</p> <p>区别在于 setInterval 在指定周期执行一次 function</p> <h2 id="window-clearinterval-id-of-setinterval"><a href="#window-clearinterval-id-of-setinterval" class="header-anchor">#</a> window.clearInterval(id_of_setinterval)</h2> <p>取消由 setInterval() 函数设定的定时执行操作</p> <h2 id="window-find-astring-acasesensitive-abackwards-awraparound-awholeword-asearchinframes-ashowdialog"><a href="#window-find-astring-acasesensitive-abackwards-awraparound-awholeword-asearchinframes-ashowdialog" class="header-anchor">#</a> window.find(aString, aCaseSensitive, aBackwards, aWrapAround, aWholeWord, aSearchInFrames, aShowDialog);</h2> <p>在一个页面中搜索指定的字符串.</p> <h2 id="window-matchmedia"><a href="#window-matchmedia" class="header-anchor">#</a> window.matchMedia()</h2> <p>返回一个新的 MediaQueryList 对象,表示指定的媒体查询 (en-US)字符串解析后的结果。</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">var</span> mql <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">matchMedia</span><span class="token punctuation">(</span><span class="token string">'(max-width: 600px)'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> el <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">createElement</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
el<span class="token punctuation">.</span>innerText <span class="token operator">=</span> mql<span class="token punctuation">.</span>matches<span class="token punctuation">;</span>
document<span class="token punctuation">.</span>documentElement<span class="token punctuation">.</span><span class="token function">appendChild</span><span class="token punctuation">(</span>el<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><h1 id="window-已废弃方法"><a href="#window-已废弃方法" class="header-anchor">#</a> window 已废弃方法</h1> <h2 id="window-getdefaultcomputedstyle"><a href="#window-getdefaultcomputedstyle" class="header-anchor">#</a> window.getDefaultComputedStyle()</h2> <p>给出元素的所有 CSS 属性的默认计算值。</p> <ul><li><p>非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!</p></li> <li><p>替换方法为:window.getComputedStyle()</p></li></ul> <h2 id="window-back"><a href="#window-back" class="header-anchor">#</a> window.back()</h2> <p>使浏览器在会话历史中向后移动一个页面。</p> <ul><li><p>非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!</p></li> <li><p>替换方法为:window.history.back()</p></li></ul> <h2 id="window-forward"><a href="#window-forward" class="header-anchor">#</a> window.forward()</h2> <p>使浏览器在会话历史中向前移动一个页面。</p> <ul><li><p>非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!</p></li> <li><p>替换方法为:window.history.forward()</p></li></ul> <h2 id="window-home"><a href="#window-home" class="header-anchor">#</a> window.home()</h2> <p>将浏览器返回到主页。</p> <h2 id="window-dump-string"><a href="#window-dump-string" class="header-anchor">#</a> window.dump(string)</h2> <p>将信息打印到 (本地) 控制台(console)</p> <ul><li><p>非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!</p></li> <li><p>替换方法为:console.log(string)</p></li></ul> <h2 id="window-captureevents"><a href="#window-captureevents" class="header-anchor">#</a> window.captureEvents()</h2> <p>注册捕捉事件。</p> <h2 id="window-dispatchevent"><a href="#window-dispatchevent" class="header-anchor">#</a> window.dispatchEvent()</h2> <p>触发捕捉事件。</p> <h1 id="window-对象-的属性"><a href="#window-对象-的属性" class="header-anchor">#</a> <code>window 对象</code> 的属性</h1> <h2 id="window-closed"><a href="#window-closed" class="header-anchor">#</a> window.closed</h2> <p>只读属性。</p> <p>表示所引用的窗口是否关闭。</p> <p>返回 Boolean</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>isClosed <span class="token operator">=</span> windowRef<span class="token punctuation">.</span>closed<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="window-console"><a href="#window-console" class="header-anchor">#</a> window.console</h2> <p>只读属性。</p> <p>浏览器控制台输出日志信息。</p> <p>仅应用于调试,并不应该用来给最终用户呈现信息。</p> <h2 id="window-crypto"><a href="#window-crypto" class="header-anchor">#</a> window.crypto</h2> <p>只读属性。</p> <p>返回与全局对象关联的 Crypto 对象。</p> <p>此对象允许网页访问某些加密相关服务。</p> <p>兼容性:ie11+,且 ie 浏览器 Workers 无法使用。</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">var</span> cryptoObj <span class="token operator">=</span> window<span class="token punctuation">.</span>crypto <span class="token operator">||</span> window<span class="token punctuation">.</span>msCrypto<span class="token punctuation">;</span> <span class="token comment">// for IE 11</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="window-devicepixelratio"><a href="#window-devicepixelratio" class="header-anchor">#</a> window.devicePixelRatio</h2> <blockquote><p>不是 W3C 标准</p></blockquote> <p>只读属性。</p> <p>返回当前显示设备的物理像素分辨率与 CSS 像素分辨率之比。</p> <p>可以使用 window.matchMedia() 检查 devicePixelRatio 的值是否发生更改(例如,如果用户将窗口拖动到带有 不同的像素密度)。</p> <h2 id="window-document"><a href="#window-document" class="header-anchor">#</a> window.document</h2> <p>只读属性。</p> <p>返回当前窗口内的文档节点(document)</p> <p>注意事项:</p> <ul><li>从 Firefox 3 和 IE7 开始,访问其他页面内的文档节点会受到同源策略的影响.</li></ul> <h2 id="window-frameelement"><a href="#window-frameelement" class="header-anchor">#</a> window.frameElement</h2> <p>只读属性。</p> <p>返回嵌入当前 window 对象的元素(比如 <iframe> 或者 <object>)</object></iframe></p> <p>如果当前 window 对象已经是顶层窗口,则返回 null.</p> <h2 id="window-frames"><a href="#window-frames" class="header-anchor">#</a> window.frames</h2> <p>只读属性。</p> <p>返回当前窗口,一个类数组对象,列出了当前窗口的所有直接子窗口。</p> <h2 id="window-history"><a href="#window-history" class="header-anchor">#</a> window.history</h2> <p>只读属性。</p> <p>用来获取 History 对象的引用。</p> <h2 id="window-location"><a href="#window-location" class="header-anchor">#</a> window.location</h2> <p>只读属性。</p> <p>返回一个 Location 对象。</p> <ul><li>href 设置或获取整个 URL 为字符串。</li> <li>host 设置或获取 URL 的 hostname 和 port 。</li> <li>hostname 设置或获取 location 或 URL 的主机名称部分。</li> <li>pathname 设置或获取对象指定的文件名或路径。</li> <li>port 设置或获取与 URL 关联的端口号码,(80 或 443)。</li> <li>protocol 设置或获取 URL 的协议部分,返回所使用的 web 协议(http:// 或 https://)</li> <li>search 设置或获取 URL 属性中跟在问号<code>?</code>后面的部分。
<ul><li>window.location.href</li></ul></li> <li>hash 设置或获取 URL 属性中跟在井号<code>#</code>后面的部分。
<ul><li>监听方式 <code>body.addEventListener("hashchange", myScript)</code></li></ul></li></ul> <h2 id="浏览器仓库"><a href="#浏览器仓库" class="header-anchor">#</a> 浏览器仓库</h2> <ul><li>window.localStorage</li> <li>window.sessionStorage</li></ul> <h2 id="window-navigator"><a href="#window-navigator" class="header-anchor">#</a> window.navigator</h2> <p>只读属性。</p> <p>Window.navigator 会返回一个 Navigator 对象的引用,可以用于请求运行当前代码的应用程序的相关信息。</p> <h2 id="window-length"><a href="#window-length" class="header-anchor">#</a> window.length</h2> <p>只读属性。</p> <p>返回当前窗口中包含的框架数量(框架包括 frame 和 iframe 两种元素).</p> <h2 id="window-name"><a href="#window-name" class="header-anchor">#</a> window.name</h2> <p>获取/设置窗口的名称。</p> <p>窗口的名字主要用于为超链接和表单设置目标(targets)。窗口不需要有名称。</p> <h2 id="window-screen"><a href="#window-screen" class="header-anchor">#</a> window.screen</h2> <p>只读属性。</p> <p>返回当前 window 的 screen 对象。</p> <h2 id="window-menubar"><a href="#window-menubar" class="header-anchor">#</a> window.menubar</h2> <p>只读属性。</p> <p>返回一个可以检测 visibility 属性的 menubar 对象。</p> <h2 id="window-personalbar"><a href="#window-personalbar" class="header-anchor">#</a> window.personalbar</h2> <p>只读属性。</p> <p>返回 personalbar 对象,其可见性可以在窗口中切换。</p> <h2 id="window-scrollbars"><a href="#window-scrollbars" class="header-anchor">#</a> window.scrollbars</h2> <p>只读属性。</p> <p>返回可以检查其可见性的滚动条对象。</p> <h1 id="相关文献"><a href="#相关文献" class="header-anchor">#</a> 相关文献</h1> <ul><li><a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window#%E6%96%B9%E6%B3%95" target="_blank" rel="noopener noreferrer">MDN-Window 对象<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><a href="https://developer.mozilla.org/zh-CN/docs/conflicting/Web/API/Window/scroll" target="_blank" rel="noopener noreferrer">MDN-ScrollToOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div> <footer class="page-edit" style="display:none;"><!----> <!----></footer> <!----> <!----></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-a936bdb4 data-v-a936bdb4><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-a936bdb4><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-a936bdb4></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-a936bdb4></path></svg></div><div id="live2d-widget" class="live2d-widget-container" style="position:fixed;right:65px;bottom:0px;width:130px;height:290px;z-index:99999;opacity:0.8;pointer-events:none;"><canvas id="live2d_canvas" width="130" height="290" class="live2d_canvas" style="position:absolute;left:0px;top:0px;width:130px;height:290px;"></canvas></div></div></div>
<script src="/idea-domain/assets/js/app.89376c8e.js" defer></script><script src="/idea-domain/assets/js/4.5465c98c.js" defer></script><script src="/idea-domain/assets/js/1.4d4f02de.js" defer></script><script src="/idea-domain/assets/js/23.1fbc2526.js" defer></script>
</body>
</html>