Window interface

接口 Window 表示包含 DOM 文档的窗口; document 属性指向在该窗口中加载的 DOM 文档。

MDN 参考

扩展

EventTarget,AnimationFrameProvider,GlobalEventHandlers,WindowEventHandlers,WindowLocalStorage,WindowOrWorkerGlobalScope,WindowSessionStorage

属性

clientInformation
closed

Window.closed只读属性指示引用的窗口是否关闭。

MDN 参考

cookieStore

cookieStore Window 接口的只读属性返回对当前文档上下文的 CookieStore 对象的引用。

MDN 参考

customElements

customElements Window 接口的只读属性返回对 CustomElementRegistry 对象的引用,该对象可用于注册新的自定义元素并获取有关以前注册的自定义元素的信息。

MDN 参考

devicePixelRatio

devicePixelRatio Window 接口返回分辨率(以物理像素为单位)与当前显示设备的 CSS 像素分辨率的比率。

MDN 参考

document

window.document 返回对窗口中包含的文档的引用。

MDN 参考

event

只读 Window 属性 event 返回当前由网站代码处理的事件。

external

external Window API 的属性返回接口的External实例,该实例旨在包含与向浏览器添加外部搜索提供程序相关的函数。

frameElement

该 Window.frameElement 属性返回嵌入窗口的元素(如 iframe 或对象)。

MDN 参考

frames

返回窗口本身,该窗口本身是一个类似数组的对象,其中列出了当前窗口的直接子帧。

MDN 参考

history

Window.history只读属性返回对 History 对象的引用,该对象提供用于操作浏览器会话历史记录的接口(在当前页加载到的选项卡或框架中访问的页面)。

MDN 参考

innerHeight

包含水平滚动条高度(如果存在)的只读 innerHeight 属性。

MDN 参考

innerWidth

只读 Window 属性 innerWidth 以像素为单位返回窗口的内部宽度(即窗口布局视区宽度)。

MDN 参考

length

返回帧数(帧或 A 数)。

MDN 参考

location

Window.location只读属性返回一个 Location 对象,其中包含有关文档当前位置的信息。

MDN 参考

locationbar

返回 locationbar 对象。

MDN 参考

menubar

返回 menubar 对象。

MDN 参考

msCrypto
name

该 Window.name 属性获取/设置窗口浏览上下文的名称。

MDN 参考

navigator

Window.navigator只读属性返回对 Navigator 对象的引用,该对象包含有关运行脚本的应用程序的方法和属性。

MDN 参考

ondevicemotion

仅在安全上下文中可用。

MDN 参考

ondeviceorientation

仅在安全上下文中可用。

MDN 参考

ondeviceorientationabsolute

仅在安全上下文中可用。

MDN 参考

onorientationchange
opener

Window 接口 opener 的属性返回对使用 Window.open 打开窗口的窗口的引用,或通过导航具有 target 属性的链接来打开窗口。

MDN 参考

orientation

返回视区相对于设备自然方向的方向(以 90 度递增为单位)。

originAgentCluster

originAgentCluster如果此窗口属于源键代理群集,则 Window 接口的只读属性将返回true:这意味着操作系统已向此窗口的源(例如操作系统进程)提供专用资源(例如操作系统进程),而该源未与其他源的窗口共享。

MDN 参考

outerHeight

Window.outerHeight只读属性返回整个浏览器窗口的高度(以像素为单位),包括任何边栏、窗口部件版式和窗口大小调整边框/句柄。

MDN 参考

outerWidth

Window.outerWidth 只读属性返回浏览器窗口外部的宽度。

MDN 参考

pageXOffset

MDN 参考

pageYOffset

MDN 参考

parent

该 Window.parent 属性是对当前窗口或子帧的父级的引用。

MDN 参考

personalbar

返回 personalbar 对象。

MDN 参考

powerbi
powerBISDKGlobalServiceInstanceName
screen

Window 属性 screen 返回对与窗口关联的屏幕对象的引用。

MDN 参考

screenLeft

Window.screenLeft只读属性返回从用户浏览器视区左侧到屏幕左侧的水平距离(以 CSS 像素为单位)。

MDN 参考

screenTop

Window.screenTop只读属性返回从用户浏览器视区上边框到屏幕顶部的垂直距离(以 CSS 像素为单位)。

MDN 参考

screenX

Window.screenX只读属性将用户的浏览器视区左边框的水平距离(以 CSS 像素为单位)返回到屏幕左侧。

MDN 参考

screenY

Window.screenY只读属性将用户的浏览器视区上边框的垂直距离(以 CSS 像素为单位)返回到屏幕的上边缘。

MDN 参考

scrollbars

返回 scrollbars 对象。

MDN 参考

scrollX

Window 接口的只读 scrollX 属性返回文档当前水平滚动的像素数。

MDN 参考

scrollY

Window 接口的只读 scrollY 属性返回文档当前垂直滚动的像素数。

MDN 参考

self

Window.self只读属性以 WindowProxy 的形式返回窗口本身。

MDN 参考

speechSynthesis

speechSynthesis Window 对象的只读属性返回 SpeechSynthesis 对象,该对象是使用 Web 语音 API 语音合成功能的入口点。

MDN 参考

status

status浏览器窗口底部栏的属性。

statusbar

返回 statusbar 对象。

MDN 参考

toolbar

返回 toolbar 对象。

MDN 参考

top

返回对窗口层次结构中最顶层窗口的引用。

MDN 参考

visualViewport

visualViewport Window 接口的只读属性返回一个 VisualViewport 对象,该对象表示给定窗口的可视视区,或者null当前文档未完全处于活动状态。

MDN 参考

window

window Window 对象的属性指向窗口对象本身。

MDN 参考

继承属性

caches

仅在安全上下文中可用。

MDN 参考

crossOriginIsolated

MDN 参考

crypto

MDN 参考

indexedDB

MDN 参考

isSecureContext

MDN 参考

localStorage

MDN 参考

onabort

MDN 参考

onafterprint

MDN 参考

onanimationcancel

MDN 参考

onanimationend

MDN 参考

onanimationiteration

MDN 参考

onanimationstart

MDN 参考

onauxclick

MDN 参考

onbeforeinput

MDN 参考

onbeforematch

MDN 参考

onbeforeprint

MDN 参考

onbeforetoggle

MDN 参考

onbeforeunload

MDN 参考

onblur

MDN 参考

oncancel

MDN 参考

oncanplay

MDN 参考

oncanplaythrough

MDN 参考

onchange

MDN 参考

onclick

MDN 参考

onclose

MDN 参考

oncontextlost

MDN 参考

oncontextmenu

MDN 参考

oncontextrestored

MDN 参考

oncopy

MDN 参考

oncuechange

MDN 参考

oncut

MDN 参考

ondblclick

MDN 参考

ondrag

MDN 参考

ondragend

MDN 参考

ondragenter

MDN 参考

ondragleave

MDN 参考

ondragover

MDN 参考

ondragstart

MDN 参考

ondrop

MDN 参考

ondurationchange

MDN 参考

onemptied

MDN 参考

onended

MDN 参考

onerror

MDN 参考

onfocus

MDN 参考

onformdata

MDN 参考

ongamepadconnected

MDN 参考

ongamepaddisconnected

MDN 参考

ongotpointercapture

MDN 参考

onhashchange

MDN 参考

oninput

MDN 参考

oninvalid

MDN 参考

onkeydown

MDN 参考

onkeypress
onkeyup

MDN 参考

onlanguagechange

MDN 参考

onload

MDN 参考

onloadeddata

MDN 参考

onloadedmetadata

MDN 参考

onloadstart

MDN 参考

onlostpointercapture

MDN 参考

onmessage

MDN 参考

onmessageerror

MDN 参考

onmousedown

MDN 参考

onmouseenter

MDN 参考

onmouseleave

MDN 参考

onmousemove

MDN 参考

onmouseout

MDN 参考

onmouseover

MDN 参考

onmouseup

MDN 参考

onoffline

MDN 参考

ononline

MDN 参考

onpagehide

MDN 参考

onpagereveal

MDN 参考

onpageshow

MDN 参考

onpageswap

MDN 参考

onpaste

MDN 参考

onpause

MDN 参考

onplay

MDN 参考

onplaying

MDN 参考

onpointercancel

MDN 参考

onpointerdown

MDN 参考

onpointerenter

MDN 参考

onpointerleave

MDN 参考

onpointermove

MDN 参考

onpointerout

MDN 参考

onpointerover

MDN 参考

onpointerrawupdate

仅在安全上下文中可用。

MDN 参考

onpointerup

MDN 参考

onpopstate

MDN 参考

onprogress

MDN 参考

onratechange

MDN 参考

onrejectionhandled

MDN 参考

onreset

MDN 参考

onresize

MDN 参考

onscroll

MDN 参考

onscrollend

MDN 参考

onsecuritypolicyviolation

MDN 参考

onseeked

MDN 参考

onseeking

MDN 参考

onselect

MDN 参考

onselectionchange

MDN 参考

onselectstart

MDN 参考

onslotchange

MDN 参考

onstalled

MDN 参考

onstorage

MDN 参考

onsubmit

MDN 参考

onsuspend

MDN 参考

ontimeupdate

MDN 参考

ontoggle

MDN 参考

ontouchcancel

MDN 参考

ontouchend

MDN 参考

ontouchmove

MDN 参考

ontouchstart

MDN 参考

ontransitioncancel

MDN 参考

ontransitionend

MDN 参考

ontransitionrun

MDN 参考

ontransitionstart

MDN 参考

onunhandledrejection

MDN 参考

onunload
onvolumechange

MDN 参考

onwaiting

MDN 参考

onwebkitanimationend
onwebkitanimationiteration
onwebkitanimationstart
onwebkittransitionend
onwheel

MDN 参考

origin

MDN 参考

performance

MDN 参考

sessionStorage

MDN 参考

方法

addEventListener(string, EventListenerOrEventListenerObject, boolean | AddEventListenerOptions)
addEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | AddEventListenerOptions)

addEventListener() EventTarget 接口的方法设置一个函数,每当指定事件传递到目标时,就会调用该函数。

MDN 参考

alert(any)

window.alert() 指示浏览器显示带有可选消息的对话框,并等待用户关闭对话框。

MDN 参考

blur()

该方法 Window.blur() 不执行任何操作。

cancelIdleCallback(number)

该方法 window.cancelIdleCallback() 取消以前使用 window.requestIdleCallback() 计划的回调。

MDN 参考

captureEvents()

该方法 Window.captureEvents() 不执行任何操作。

close()

该方法 Window.close() 关闭当前窗口或调用它的窗口。

MDN 参考

confirm(string)

window.confirm() 指示浏览器显示带有可选消息的对话框,并等待用户确认或取消对话框。

MDN 参考

focus()

发出将窗口置于前面的请求。

MDN 参考

getComputedStyle(Element, string | null)

该方法 Window.getComputedStyle() 返回一个对象,该对象包含元素的所有 CSS 属性的值,应用活动样式表并解析这些值可能包含的任何基本计算。

MDN 参考

getSelection()

getSelection() Window 接口的方法返回与窗口文档关联的 Selection 对象,该对象表示用户选择的文本范围或插入符号的当前位置。

MDN 参考

matchMedia(string)

Window 接口 matchMedia() 的方法返回一个新的 MediaQueryList 对象,该对象随后可用于确定文档是否与媒体查询字符串匹配,以及监视文档以检测它何时与媒体查询匹配(或停止匹配)。

MDN 参考

moveBy(number, number)

moveBy() Window 接口的方法按指定数量移动当前窗口。

MDN 参考

moveTo(number, number)

moveTo() Window 接口的方法将当前窗口移动到指定的坐标。

MDN 参考

open(string | URL, string, string)

接口的方法Window将open()指定的资源加载到指定名称下的新的或现有的浏览上下文(即选项卡、窗口或 iframe)。

MDN 参考

postMessage(any, string, Transferable[])

该方法 window.postMessage() 安全地在 Window 对象之间实现跨源通信; 例如, 在页面和它生成的弹出窗口之间,或在页面和嵌入其中的 iframe 之间。

MDN 参考

postMessage(any, WindowPostMessageOptions)
print()

打开打印对话框以打印当前文档。

MDN 参考

prompt(string, string)

window.prompt() 指示浏览器显示一个对话框,其中包含一条可选消息,提示用户输入一些文本,并等待用户提交文本或取消对话框。

MDN 参考

releaseEvents()

释放窗口以捕获特定类型的事件。

removeEventListener(string, EventListenerOrEventListenerObject, boolean | EventListenerOptions)
removeEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | EventListenerOptions)

removeEventListener() EventTarget 接口的方法从目标中删除以前向 EventTarget.addEventListener() 注册的事件侦听器。

MDN 参考

requestIdleCallback(IdleRequestCallback, IdleRequestOptions)

该方法 window.requestIdleCallback() 会将在浏览器空闲期间调用的函数排到队列中。

MDN 参考

resizeBy(number, number)

该方法 Window.resizeBy() 按指定量调整当前窗口的大小。

MDN 参考

resizeTo(number, number)

该方法 Window.resizeTo() 动态调整窗口的大小。

MDN 参考

scroll(number, number)
scroll(ScrollToOptions)

该方法 Window.scroll() 将窗口滚动到文档中的特定位置。

MDN 参考

scrollBy(number, number)
scrollBy(ScrollToOptions)

该方法 Window.scrollBy() 按给定的金额滚动窗口中的文档。

MDN 参考

scrollTo(number, number)
scrollTo(ScrollToOptions)

Window.scrollTo() 滚动到文档中的一组特定坐标。

MDN 参考

stop()

在 window.stop() 当前浏览上下文中停止进一步加载资源,相当于浏览器中的“停止”按钮。

MDN 参考

属性详细信息

clientInformation

警告

现已弃用此 API。

This is a legacy alias of navigator.

MDN Reference

clientInformation: Navigator

属性值

Navigator

closed

Window.closed只读属性指示引用的窗口是否关闭。

MDN 参考

closed: boolean

属性值

boolean

cookieStore

cookieStore Window 接口的只读属性返回对当前文档上下文的 CookieStore 对象的引用。

MDN 参考

cookieStore: CookieStore

属性值

CookieStore

customElements

customElements Window 接口的只读属性返回对 CustomElementRegistry 对象的引用,该对象可用于注册新的自定义元素并获取有关以前注册的自定义元素的信息。

MDN 参考

customElements: CustomElementRegistry

属性值

CustomElementRegistry

devicePixelRatio

devicePixelRatio Window 接口返回分辨率(以物理像素为单位)与当前显示设备的 CSS 像素分辨率的比率。

MDN 参考

devicePixelRatio: number

属性值

number

document

window.document 返回对窗口中包含的文档的引用。

MDN 参考

document: Document

属性值

event

警告

现已弃用此 API。

MDN Reference

只读 Window 属性 event 返回当前由网站代码处理的事件。

event: Event | undefined

属性值

Event | undefined

external

警告

现已弃用此 API。

MDN Reference

external Window API 的属性返回接口的External实例,该实例旨在包含与向浏览器添加外部搜索提供程序相关的函数。

external: External

属性值

External

frameElement

该 Window.frameElement 属性返回嵌入窗口的元素(如 iframe 或对象)。

MDN 参考

frameElement: Element | null

属性值

Element | null

frames

返回窗口本身,该窗口本身是一个类似数组的对象,其中列出了当前窗口的直接子帧。

MDN 参考

frames: Window

属性值

history

Window.history只读属性返回对 History 对象的引用,该对象提供用于操作浏览器会话历史记录的接口(在当前页加载到的选项卡或框架中访问的页面)。

MDN 参考

history: History

属性值

History

innerHeight

包含水平滚动条高度(如果存在)的只读 innerHeight 属性。

MDN 参考

innerHeight: number

属性值

number

innerWidth

只读 Window 属性 innerWidth 以像素为单位返回窗口的内部宽度(即窗口布局视区宽度)。

MDN 参考

innerWidth: number

属性值

number

length

返回帧数(帧或 A 数)。

MDN 参考

length: number

属性值

number

location

Window.location只读属性返回一个 Location 对象,其中包含有关文档当前位置的信息。

MDN 参考

Location location

属性值

Location

locationbar

返回 locationbar 对象。

MDN 参考

locationbar: BarProp

属性值

BarProp

menubar

返回 menubar 对象。

MDN 参考

menubar: BarProp

属性值

BarProp

msCrypto

msCrypto: Crypto

属性值

Crypto

name

该 Window.name 属性获取/设置窗口浏览上下文的名称。

MDN 参考

name: string

属性值

string

navigator

Window.navigator只读属性返回对 Navigator 对象的引用,该对象包含有关运行脚本的应用程序的方法和属性。

MDN 参考

navigator: Navigator

属性值

Navigator

ondevicemotion

仅在安全上下文中可用。

MDN 参考

ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any | null

属性值

(this: Window, ev: DeviceMotionEvent) => any | null

ondeviceorientation

仅在安全上下文中可用。

MDN 参考

ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any | null

属性值

(this: Window, ev: DeviceOrientationEvent) => any | null

ondeviceorientationabsolute

仅在安全上下文中可用。

MDN 参考

ondeviceorientationabsolute: (this: Window, ev: DeviceOrientationEvent) => any | null

属性值

(this: Window, ev: DeviceOrientationEvent) => any | null

onorientationchange

警告

现已弃用此 API。

MDN Reference

onorientationchange: (this: Window, ev: Event) => any | null

属性值

(this: Window, ev: Event) => any | null

opener

Window 接口 opener 的属性返回对使用 Window.open 打开窗口的窗口的引用,或通过导航具有 target 属性的链接来打开窗口。

MDN 参考

opener: any

属性值

any

orientation

警告

现已弃用此 API。

MDN Reference

返回视区相对于设备自然方向的方向(以 90 度递增为单位)。

orientation: number

属性值

number

originAgentCluster

originAgentCluster如果此窗口属于源键代理群集,则 Window 接口的只读属性将返回true:这意味着操作系统已向此窗口的源(例如操作系统进程)提供专用资源(例如操作系统进程),而该源未与其他源的窗口共享。

MDN 参考

originAgentCluster: boolean

属性值

boolean

outerHeight

Window.outerHeight只读属性返回整个浏览器窗口的高度(以像素为单位),包括任何边栏、窗口部件版式和窗口大小调整边框/句柄。

MDN 参考

outerHeight: number

属性值

number

outerWidth

Window.outerWidth 只读属性返回浏览器窗口外部的宽度。

MDN 参考

outerWidth: number

属性值

number

pageXOffset

MDN 参考

pageXOffset: number

属性值

number

pageYOffset

MDN 参考

pageYOffset: number

属性值

number

parent

该 Window.parent 属性是对当前窗口或子帧的父级的引用。

MDN 参考

parent: Window

属性值

personalbar

返回 personalbar 对象。

MDN 参考

personalbar: BarProp

属性值

BarProp

powerbi

powerbi: Service

属性值

powerBISDKGlobalServiceInstanceName

powerBISDKGlobalServiceInstanceName?: string

属性值

string

screen

Window 属性 screen 返回对与窗口关联的屏幕对象的引用。

MDN 参考

screen: Screen

属性值

Screen

screenLeft

Window.screenLeft只读属性返回从用户浏览器视区左侧到屏幕左侧的水平距离(以 CSS 像素为单位)。

MDN 参考

screenLeft: number

属性值

number

screenTop

Window.screenTop只读属性返回从用户浏览器视区上边框到屏幕顶部的垂直距离(以 CSS 像素为单位)。

MDN 参考

screenTop: number

属性值

number

screenX

Window.screenX只读属性将用户的浏览器视区左边框的水平距离(以 CSS 像素为单位)返回到屏幕左侧。

MDN 参考

screenX: number

属性值

number

screenY

Window.screenY只读属性将用户的浏览器视区上边框的垂直距离(以 CSS 像素为单位)返回到屏幕的上边缘。

MDN 参考

screenY: number

属性值

number

scrollbars

返回 scrollbars 对象。

MDN 参考

scrollbars: BarProp

属性值

BarProp

scrollX

Window 接口的只读 scrollX 属性返回文档当前水平滚动的像素数。

MDN 参考

scrollX: number

属性值

number

scrollY

Window 接口的只读 scrollY 属性返回文档当前垂直滚动的像素数。

MDN 参考

scrollY: number

属性值

number

self

Window.self只读属性以 WindowProxy 的形式返回窗口本身。

MDN 参考

self: Window & typeof globalThis

属性值

Window & typeof globalThis

speechSynthesis

speechSynthesis Window 对象的只读属性返回 SpeechSynthesis 对象,该对象是使用 Web 语音 API 语音合成功能的入口点。

MDN 参考

speechSynthesis: SpeechSynthesis

属性值

SpeechSynthesis

status

警告

现已弃用此 API。

MDN Reference

status浏览器窗口底部栏的属性。

status: string

属性值

string

statusbar

返回 statusbar 对象。

MDN 参考

statusbar: BarProp

属性值

BarProp

toolbar

返回 toolbar 对象。

MDN 参考

toolbar: BarProp

属性值

BarProp

top

返回对窗口层次结构中最顶层窗口的引用。

MDN 参考

top: Window | null

属性值

Window | null

visualViewport

visualViewport Window 接口的只读属性返回一个 VisualViewport 对象,该对象表示给定窗口的可视视区,或者null当前文档未完全处于活动状态。

MDN 参考

visualViewport: VisualViewport | null

属性值

VisualViewport | null

window

window Window 对象的属性指向窗口对象本身。

MDN 参考

window: Window & typeof globalThis

属性值

Window & typeof globalThis

继承属性详细信息

caches

仅在安全上下文中可用。

MDN 参考

caches: CacheStorage

属性值

CacheStorage

继承自 WindowOrWorkerGlobalScope.caches

crossOriginIsolated

MDN 参考

crossOriginIsolated: boolean

属性值

boolean

继承自 WindowOrWorkerGlobalScope.crossOriginIsolated

crypto

MDN 参考

crypto: Crypto

属性值

Crypto

继承自 WindowOrWorkerGlobalScope.crypto

indexedDB

MDN 参考

indexedDB: IDBFactory

属性值

IDBFactory

继承自 WindowOrWorkerGlobalScope.indexedDB

isSecureContext

MDN 参考

isSecureContext: boolean

属性值

boolean

继承自 WindowOrWorkerGlobalScope.isSecureContext

localStorage

MDN 参考

localStorage: Storage

属性值

Storage

继承自 WindowLocalStorage.localStorage

onabort

MDN 参考

onabort: (this: GlobalEventHandlers, ev: UIEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: UIEvent) => any | null

继承自 GlobalEventHandlers.onabort

onafterprint

MDN 参考

onafterprint: (this: WindowEventHandlers, ev: Event) => any | null

属性值

(this: WindowEventHandlers, ev: Event) => any | null

继承自 WindowEventHandlers.onafterprint

onanimationcancel

MDN 参考

onanimationcancel: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: AnimationEvent) => any | null

继承自 GlobalEventHandlers.onanimationcancel

onanimationend

MDN 参考

onanimationend: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: AnimationEvent) => any | null

继承自 GlobalEventHandlers.onanimationend

onanimationiteration

MDN 参考

onanimationiteration: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: AnimationEvent) => any | null

继承自 GlobalEventHandlers.onanimationiteration

onanimationstart

MDN 参考

onanimationstart: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: AnimationEvent) => any | null

继承自 GlobalEventHandlers.onanimationstart

onauxclick

MDN 参考

onauxclick: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onauxclick

onbeforeinput

MDN 参考

onbeforeinput: (this: GlobalEventHandlers, ev: InputEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: InputEvent) => any | null

继承自 GlobalEventHandlers.onbeforeinput

onbeforematch

MDN 参考

onbeforematch: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onbeforematch

onbeforeprint

MDN 参考

onbeforeprint: (this: WindowEventHandlers, ev: Event) => any | null

属性值

(this: WindowEventHandlers, ev: Event) => any | null

继承自 WindowEventHandlers.onbeforeprint

onbeforetoggle

MDN 参考

onbeforetoggle: (this: GlobalEventHandlers, ev: ToggleEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: ToggleEvent) => any | null

继承自 GlobalEventHandlers.onbeforetoggle

onbeforeunload

MDN 参考

onbeforeunload: (this: WindowEventHandlers, ev: BeforeUnloadEvent) => any | null

属性值

(this: WindowEventHandlers, ev: BeforeUnloadEvent) => any | null

继承自 WindowEventHandlers.onbeforeunload

onblur

MDN 参考

onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: FocusEvent) => any | null

继承自 GlobalEventHandlers.onblur

oncancel

MDN 参考

oncancel: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 globalEventHandlers.oncancel 的

oncanplay

MDN 参考

oncanplay: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oncanplay

oncanplaythrough

MDN 参考

oncanplaythrough: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oncanplaythrough

onchange

MDN 参考

onchange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onchange

onclick

MDN 参考

onclick: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onclick

onclose

MDN 参考

onclose: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onclose

oncontextlost

MDN 参考

oncontextlost: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oncontextlost

oncontextmenu

MDN 参考

oncontextmenu: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.oncontextmenu

oncontextrestored

MDN 参考

oncontextrestored: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oncontextrestored

oncopy

MDN 参考

oncopy: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null

继承自 GlobalEventHandlers.oncopy

oncuechange

MDN 参考

oncuechange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oncuechange

oncut

MDN 参考

oncut: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null

继承自 GlobalEventHandlers.oncut

ondblclick

MDN 参考

ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.ondblclick

ondrag

MDN 参考

ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondrag

ondragend

MDN 参考

ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondragend

ondragenter

MDN 参考

ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondragenter

ondragleave

MDN 参考

ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondragleave

ondragover

MDN 参考

ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondragover

ondragstart

MDN 参考

ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondragstart

ondrop

MDN 参考

ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: DragEvent) => any | null

继承自 GlobalEventHandlers.ondrop

ondurationchange

MDN 参考

ondurationchange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.ondurationchange

onemptied

MDN 参考

onemptied: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onemptied

onended

MDN 参考

onended: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onended

onerror

MDN 参考

onerror: OnErrorEventHandler

属性值

OnErrorEventHandler

继承自 GlobalEventHandlers.onerror

onfocus

MDN 参考

onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: FocusEvent) => any | null

继承自 GlobalEventHandlers.onfocus

onformdata

MDN 参考

onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: FormDataEvent) => any | null

继承自 GlobalEventHandlers.onformdata

ongamepadconnected

MDN 参考

ongamepadconnected: (this: WindowEventHandlers, ev: GamepadEvent) => any | null

属性值

(this: WindowEventHandlers, ev: GamepadEvent) => any | null

继承自 WindowEventHandlers.ongamepadconnected

ongamepaddisconnected

MDN 参考

ongamepaddisconnected: (this: WindowEventHandlers, ev: GamepadEvent) => any | null

属性值

(this: WindowEventHandlers, ev: GamepadEvent) => any | null

继承自 WindowEventHandlers.ongamepaddisconnected

ongotpointercapture

MDN 参考

ongotpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.ongotpointercapture

onhashchange

MDN 参考

onhashchange: (this: WindowEventHandlers, ev: HashChangeEvent) => any | null

属性值

(this: WindowEventHandlers, ev: HashChangeEvent) => any | null

继承自 WindowEventHandlers.onhashchange

oninput

MDN 参考

oninput: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oninput

oninvalid

MDN 参考

oninvalid: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.oninvalid

onkeydown

MDN 参考

onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null

继承自 GlobalEventHandlers.onkeydown

onkeypress

警告

现已弃用此 API。

MDN Reference

onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null

继承自 GlobalEventHandlers.onkeypress 的

onkeyup

MDN 参考

onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null

继承自 GlobalEventHandlers.onkeyup

onlanguagechange

MDN 参考

onlanguagechange: (this: WindowEventHandlers, ev: Event) => any | null

属性值

(this: WindowEventHandlers, ev: Event) => any | null

继承自 WindowEventHandlers.onlanguagechange

onload

MDN 参考

onload: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onload

onloadeddata

MDN 参考

onloadeddata: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onloadeddata

onloadedmetadata

MDN 参考

onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onloadedmetadata

onloadstart

MDN 参考

onloadstart: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onloadstart

onlostpointercapture

MDN 参考

onlostpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onlostpointercapture

onmessage

MDN 参考

onmessage: (this: WindowEventHandlers, ev: MessageEvent) => any | null

属性值

(this: WindowEventHandlers, ev: MessageEvent) => any | null

继承自 WindowEventHandlers.onmessage

onmessageerror

MDN 参考

onmessageerror: (this: WindowEventHandlers, ev: MessageEvent) => any | null

属性值

(this: WindowEventHandlers, ev: MessageEvent) => any | null

继承自 WindowEventHandlers.onmessageerror

onmousedown

MDN 参考

onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmousedown

onmouseenter

MDN 参考

onmouseenter: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmouseenter

onmouseleave

MDN 参考

onmouseleave: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmouseleave

onmousemove

MDN 参考

onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmousemove

onmouseout

MDN 参考

onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmouseout

onmouseover

MDN 参考

onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmouseover

onmouseup

MDN 参考

onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: MouseEvent) => any | null

继承自 GlobalEventHandlers.onmouseup

onoffline

MDN 参考

onoffline: (this: WindowEventHandlers, ev: Event) => any | null

属性值

(this: WindowEventHandlers, ev: Event) => any | null

继承自 WindowEventHandlers.onoffline

ononline

MDN 参考

ononline: (this: WindowEventHandlers, ev: Event) => any | null

属性值

(this: WindowEventHandlers, ev: Event) => any | null

继承自 WindowEventHandlers.ononline

onpagehide

MDN 参考

onpagehide: (this: WindowEventHandlers, ev: PageTransitionEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PageTransitionEvent) => any | null

继承自 WindowEventHandlers.onpagehide

onpagereveal

MDN 参考

onpagereveal: (this: WindowEventHandlers, ev: PageRevealEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PageRevealEvent) => any | null

继承自 WindowEventHandlers.onpagereveal

onpageshow

MDN 参考

onpageshow: (this: WindowEventHandlers, ev: PageTransitionEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PageTransitionEvent) => any | null

继承自 WindowEventHandlers.onpageshow

onpageswap

MDN 参考

onpageswap: (this: WindowEventHandlers, ev: PageSwapEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PageSwapEvent) => any | null

继承自 WindowEventHandlers.onpageswap

onpaste

MDN 参考

onpaste: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null

继承自 GlobalEventHandlers.onpaste

onpause

MDN 参考

onpause: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onpause

onplay

MDN 参考

onplay: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onplay

onplaying

MDN 参考

onplaying: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onplaying

onpointercancel

MDN 参考

onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointercancel

onpointerdown

MDN 参考

onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointerdown

onpointerenter

MDN 参考

onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointerenter

onpointerleave

MDN 参考

onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointerleave

onpointermove

MDN 参考

onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointermove

onpointerout

MDN 参考

onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointerout

onpointerover

MDN 参考

onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointerover

onpointerrawupdate

仅在安全上下文中可用。

MDN 参考

onpointerrawupdate: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onpointerrawupdate

onpointerup

MDN 参考

onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: PointerEvent) => any | null

继承自 GlobalEventHandlers.onpointerup

onpopstate

MDN 参考

onpopstate: (this: WindowEventHandlers, ev: PopStateEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PopStateEvent) => any | null

继承自 WindowEventHandlers.onpopstate

onprogress

MDN 参考

onprogress: (this: GlobalEventHandlers, ev: ProgressEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: ProgressEvent) => any | null

继承自 GlobalEventHandlers.onprogress

onratechange

MDN 参考

onratechange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onratechange

onrejectionhandled

MDN 参考

onrejectionhandled: (this: WindowEventHandlers, ev: PromiseRejectionEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PromiseRejectionEvent) => any | null

继承自 WindowEventHandlers.onrejectionhandled

onreset

MDN 参考

onreset: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onreset

onresize

MDN 参考

onresize: (this: GlobalEventHandlers, ev: UIEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: UIEvent) => any | null

继承自 GlobalEventHandlers.onresize

onscroll

MDN 参考

onscroll: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onscroll

onscrollend

MDN 参考

onscrollend: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onscrollend

onsecuritypolicyviolation

MDN 参考

onsecuritypolicyviolation: (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any | null

继承自 GlobalEventHandlers.onsecuritypolicyviolation

onseeked

MDN 参考

onseeked: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onseeked

onseeking

MDN 参考

onseeking: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onseeking

onselect

MDN 参考

onselect: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onselect

onselectionchange

MDN 参考

onselectionchange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onselectionchange

onselectstart

MDN 参考

onselectstart: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onselectstart

onslotchange

MDN 参考

onslotchange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onslotchange

onstalled

MDN 参考

onstalled: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onstalled

onstorage

MDN 参考

onstorage: (this: WindowEventHandlers, ev: StorageEvent) => any | null

属性值

(this: WindowEventHandlers, ev: StorageEvent) => any | null

继承自 WindowEventHandlers.onstorage

onsubmit

MDN 参考

onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: SubmitEvent) => any | null

继承自 GlobalEventHandlers.onsubmit

onsuspend

MDN 参考

onsuspend: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onsuspend

ontimeupdate

MDN 参考

ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.ontimeupdate

ontoggle

MDN 参考

ontoggle: (this: GlobalEventHandlers, ev: ToggleEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: ToggleEvent) => any | null

继承自 GlobalEventHandlers.onggle

ontouchcancel

MDN 参考

ontouchcancel?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TouchEvent) => any | null

继承自 GlobalEventHandlers.ontouchcancel

ontouchend

MDN 参考

ontouchend?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TouchEvent) => any | null

继承自 GlobalEventHandlers.ontouchend

ontouchmove

MDN 参考

ontouchmove?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TouchEvent) => any | null

继承自 GlobalEventHandlers.ontouchmove

ontouchstart

MDN 参考

ontouchstart?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TouchEvent) => any | null

继承自 GlobalEventHandlers.ontouchstart

ontransitioncancel

MDN 参考

ontransitioncancel: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TransitionEvent) => any | null

继承自 GlobalEventHandlers.ontransitioncancel

ontransitionend

MDN 参考

ontransitionend: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TransitionEvent) => any | null

继承自 GlobalEventHandlers.ontransitionend

ontransitionrun

MDN 参考

ontransitionrun: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TransitionEvent) => any | null

继承自 GlobalEventHandlers.ontransitionrun

ontransitionstart

MDN 参考

ontransitionstart: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: TransitionEvent) => any | null

继承自 GlobalEventHandlers.ontransitionstart

onunhandledrejection

MDN 参考

onunhandledrejection: (this: WindowEventHandlers, ev: PromiseRejectionEvent) => any | null

属性值

(this: WindowEventHandlers, ev: PromiseRejectionEvent) => any | null

继承自 WindowEventHandlers.onunhandledrejection

onunload

警告

现已弃用此 API。

MDN Reference

onunload: (this: WindowEventHandlers, ev: Event) => any | null

属性值

(this: WindowEventHandlers, ev: Event) => any | null

继承自 WindowEventHandlers.onunload

onvolumechange

MDN 参考

onvolumechange: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onvolumechange

onwaiting

MDN 参考

onwaiting: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onwaiting

onwebkitanimationend

警告

现已弃用此 API。

This is a legacy alias of onanimationend.

MDN Reference

onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onwebkitanimationend

onwebkitanimationiteration

警告

现已弃用此 API。

This is a legacy alias of onanimationiteration.

MDN Reference

onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onwebkitanimationiteration

onwebkitanimationstart

警告

现已弃用此 API。

This is a legacy alias of onanimationstart.

MDN Reference

onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onwebkitanimationstart

onwebkittransitionend

警告

现已弃用此 API。

This is a legacy alias of ontransitionend.

MDN Reference

onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any | null

属性值

(this: GlobalEventHandlers, ev: Event) => any | null

继承自 GlobalEventHandlers.onwebkittransitionend

onwheel

MDN 参考

onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any | null

属性值

(this: GlobalEventHandlers, ev: WheelEvent) => any | null

继承自 GlobalEventHandlers.onwheel

origin

MDN 参考

origin: string

属性值

string

继承自 WindowOrWorkerGlobalScope.origin

performance

MDN 参考

performance: Performance

属性值

Performance

继承自 WindowOrWorkerGlobalScope.performance

sessionStorage

MDN 参考

sessionStorage: Storage

属性值

Storage

继承自 WindowSessionStorage.sessionStorage

方法详细信息

addEventListener(string, EventListenerOrEventListenerObject, boolean | AddEventListenerOptions)

function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions)

参数

type

string

listener

EventListenerOrEventListenerObject

options

boolean | AddEventListenerOptions

addEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | AddEventListenerOptions)

addEventListener() EventTarget 接口的方法设置一个函数,每当指定事件传递到目标时,就会调用该函数。

MDN 参考

function addEventListener<K>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions)

参数

type

K

listener

(this: Window, ev: WindowEventMap[K]) => any

options

boolean | AddEventListenerOptions

alert(any)

window.alert() 指示浏览器显示带有可选消息的对话框,并等待用户关闭对话框。

MDN 参考

function alert(message?: any)

参数

message

any

blur()

警告

现已弃用此 API。

MDN Reference

该方法 Window.blur() 不执行任何操作。

function blur()

cancelIdleCallback(number)

该方法 window.cancelIdleCallback() 取消以前使用 window.requestIdleCallback() 计划的回调。

MDN 参考

function cancelIdleCallback(handle: number)

参数

handle

number

captureEvents()

警告

现已弃用此 API。

MDN Reference

该方法 Window.captureEvents() 不执行任何操作。

function captureEvents()

close()

该方法 Window.close() 关闭当前窗口或调用它的窗口。

MDN 参考

function close()

confirm(string)

window.confirm() 指示浏览器显示带有可选消息的对话框,并等待用户确认或取消对话框。

MDN 参考

function confirm(message?: string): boolean

参数

message

string

返回

boolean

focus()

发出将窗口置于前面的请求。

MDN 参考

function focus()

getComputedStyle(Element, string | null)

该方法 Window.getComputedStyle() 返回一个对象,该对象包含元素的所有 CSS 属性的值,应用活动样式表并解析这些值可能包含的任何基本计算。

MDN 参考

function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration

参数

elt

Element

pseudoElt

string | null

返回

CSSStyleDeclaration

getSelection()

getSelection() Window 接口的方法返回与窗口文档关联的 Selection 对象,该对象表示用户选择的文本范围或插入符号的当前位置。

MDN 参考

function getSelection(): Selection | null

返回

Selection | null

matchMedia(string)

Window 接口 matchMedia() 的方法返回一个新的 MediaQueryList 对象,该对象随后可用于确定文档是否与媒体查询字符串匹配,以及监视文档以检测它何时与媒体查询匹配(或停止匹配)。

MDN 参考

function matchMedia(query: string): MediaQueryList

参数

query

string

返回

MediaQueryList

moveBy(number, number)

moveBy() Window 接口的方法按指定数量移动当前窗口。

MDN 参考

function moveBy(x: number, y: number)

参数

x

number

y

number

moveTo(number, number)

moveTo() Window 接口的方法将当前窗口移动到指定的坐标。

MDN 参考

function moveTo(x: number, y: number)

参数

x

number

y

number

open(string | URL, string, string)

接口的方法Window将open()指定的资源加载到指定名称下的新的或现有的浏览上下文(即选项卡、窗口或 iframe)。

MDN 参考

function open(url?: string | URL, target?: string, features?: string): Window | null

参数

url

string | URL

target

string

features

string

返回

Window | null

postMessage(any, string, Transferable[])

该方法 window.postMessage() 安全地在 Window 对象之间实现跨源通信; 例如, 在页面和它生成的弹出窗口之间,或在页面和嵌入其中的 iframe 之间。

MDN 参考

function postMessage(message: any, targetOrigin: string, transfer?: Transferable[])

参数

message

any

targetOrigin

string

transfer

Transferable[]

postMessage(any, WindowPostMessageOptions)

function postMessage(message: any, options?: WindowPostMessageOptions)

参数

message

any

options

WindowPostMessageOptions

print()

打开打印对话框以打印当前文档。

MDN 参考

function print()

prompt(string, string)

window.prompt() 指示浏览器显示一个对话框,其中包含一条可选消息,提示用户输入一些文本,并等待用户提交文本或取消对话框。

MDN 参考

function prompt(message?: string, _default?: string): string | null

参数

message

string

_default

string

返回

string | null

releaseEvents()

警告

现已弃用此 API。

MDN Reference

释放窗口以捕获特定类型的事件。

function releaseEvents()

removeEventListener(string, EventListenerOrEventListenerObject, boolean | EventListenerOptions)

function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions)

参数

type

string

listener

EventListenerOrEventListenerObject

options

boolean | EventListenerOptions

removeEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | EventListenerOptions)

removeEventListener() EventTarget 接口的方法从目标中删除以前向 EventTarget.addEventListener() 注册的事件侦听器。

MDN 参考

function removeEventListener<K>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions)

参数

type

K

listener

(this: Window, ev: WindowEventMap[K]) => any

options

boolean | EventListenerOptions

requestIdleCallback(IdleRequestCallback, IdleRequestOptions)

该方法 window.requestIdleCallback() 会将在浏览器空闲期间调用的函数排到队列中。

MDN 参考

function requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): number

参数

callback

IdleRequestCallback

options

IdleRequestOptions

返回

number

resizeBy(number, number)

该方法 Window.resizeBy() 按指定量调整当前窗口的大小。

MDN 参考

function resizeBy(x: number, y: number)

参数

x

number

y

number

resizeTo(number, number)

该方法 Window.resizeTo() 动态调整窗口的大小。

MDN 参考

function resizeTo(width: number, height: number)

参数

width

number

height

number

scroll(number, number)

function scroll(x: number, y: number)

参数

x

number

y

number

scroll(ScrollToOptions)

该方法 Window.scroll() 将窗口滚动到文档中的特定位置。

MDN 参考

function scroll(options?: ScrollToOptions)

参数

options

ScrollToOptions

scrollBy(number, number)

function scrollBy(x: number, y: number)

参数

x

number

y

number

scrollBy(ScrollToOptions)

该方法 Window.scrollBy() 按给定的金额滚动窗口中的文档。

MDN 参考

function scrollBy(options?: ScrollToOptions)

参数

options

ScrollToOptions

scrollTo(number, number)

function scrollTo(x: number, y: number)

参数

x

number

y

number

scrollTo(ScrollToOptions)

Window.scrollTo() 滚动到文档中的一组特定坐标。

MDN 参考

function scrollTo(options?: ScrollToOptions)

参数

options

ScrollToOptions

stop()

在 window.stop() 当前浏览上下文中停止进一步加载资源,相当于浏览器中的“停止”按钮。

MDN 参考

function stop()

继承的方法详细信息

atob(string)

MDN 参考

function atob(data: string): string

参数

data

string

返回

string

继承自 WindowOrWorkerGlobalScope.atob

btoa(string)

MDN 参考

function btoa(data: string): string

参数

data

string

返回

string

继承自 WindowOrWorkerGlobalScope.btoa

cancelAnimationFrame(number)

MDN 参考

function cancelAnimationFrame(handle: number)

参数

handle

number

继承自 AnimationFrameProvider.cancelAnimationFrame

clearInterval(number | undefined)

MDN 参考

function clearInterval(id: number | undefined)

参数

id

number | undefined

继承自 WindowOrWorkerGlobalScope.clearInterval

clearTimeout(number | undefined)

MDN 参考

function clearTimeout(id: number | undefined)

参数

id

number | undefined

继承自 WindowOrWorkerGlobalScope.clearTimeout

createImageBitmap(ImageBitmapSource, ImageBitmapOptions)

MDN 参考

function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>

参数

image

ImageBitmapSource

options

ImageBitmapOptions

返回

Promise<ImageBitmap>

继承自 WindowOrWorkerGlobalScope.createImageBitmap

createImageBitmap(ImageBitmapSource, number, number, number, number, ImageBitmapOptions)

function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>

参数

image

ImageBitmapSource

sx

number

sy

number

sw

number

sh

number

options

ImageBitmapOptions

返回

Promise<ImageBitmap>

继承自 WindowOrWorkerGlobalScope.createImageBitmap

dispatchEvent(Event)

dispatchEvent() EventTarget 的方法按适当的顺序将事件发送到对象(同步)调用受影响的事件侦听器。

MDN 参考

function dispatchEvent(event: Event): boolean

参数

event

Event

返回

boolean

继承自 EventTarget.dispatchEvent

fetch(URL | RequestInfo, RequestInit)

MDN 参考

function fetch(input: URL | RequestInfo, init?: RequestInit): Promise<Response>

参数

input

URL | RequestInfo

init

RequestInit

返回

Promise<Response>

继承自 WindowOrWorkerGlobalScope.fetch

queueMicrotask(VoidFunction)

MDN 参考

function queueMicrotask(callback: VoidFunction)

参数

callback

VoidFunction

继承自 WindowOrWorkerGlobalScope.queueMicrotask

reportError(any)

MDN 参考

function reportError(e: any)

参数

e

any

继承自 WindowOrWorkerGlobalScope.reportError

requestAnimationFrame(FrameRequestCallback)

MDN 参考

function requestAnimationFrame(callback: FrameRequestCallback): number

参数

callback

FrameRequestCallback

返回

number

继承自 AnimationFrameProvider.requestAnimationFrame

setInterval(TimerHandler, number, any[])

MDN 参考

function setInterval(handler: TimerHandler, timeout?: number, arguments: any[]): number

参数

handler

TimerHandler

timeout

number

arguments

any[]

返回

number

继承自 WindowOrWorkerGlobalScope.setInterval

setTimeout(TimerHandler, number, any[])

MDN 参考

function setTimeout(handler: TimerHandler, timeout?: number, arguments: any[]): number

参数

handler

TimerHandler

timeout

number

arguments

any[]

返回

number

继承自 WindowOrWorkerGlobalScope.setTimeout

structuredClone<T>(T, StructuredSerializeOptions)

MDN 参考

function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T

参数

value

T

options

StructuredSerializeOptions

返回

T

继承自 WindowOrWorkerGlobalScope.structuredClone