Window
Window
인터페이스는 DOM 문서를 담은 창을 나타냅니다. document
속성이 창에 불러온 DOM 문서를 가리킵니다. 반대로, 주어진 문서의 창은 document.defaultView
를 사용해 접근할 수 있습니다.
JavaScript 코드에 노출된 전역 변수 window
는 현재 스크립트가 작동 중인 창을 나타냅니다.
Window
인터페이스는 다양한 함수, 이름공간, 객체, 생성자가 머무는 장소입니다. 그 중엔 사용자 인터페이스로서의 창 개념과는 직접 관련되지 않은 것도 존재하며, 대신 전역적으로 접근할 수 있어야 하는 항목에 적합합니다. 많은 수의 항목이 JavaScript 참고서와 DOM 참고서에 문서화되어 있습니다.
탭 기능이 있는 브라우저에서는 각각의 탭을 각각의 Window
객체로 나타냅니다. 주어진 탭에서 동작 중인 JavaScript 코드의 전역 window
객체는 항상 자신의 탭을 나타냅니다. 그렇지만 resizeTo()
와 innerHeight
처럼, 일부 속성과 메서드는 탭이 아닌 창 전체에 적용됩니다. 보통 탭과 합리적으로는 연관 지을 수 없는 경우 창에 속합니다.
생성자
DOM 인터페이스도 참고하세요.
DOMParser
-
DOMParser
는 문자열에 저장한 XML 또는 HTML 소스 코드를 DOMDocument
로 구문 분석할 수 있습니다.DOMParser
는 DOM Parsing and Serialization 명세의 일부입니다. Image
(en-US)-
HTMLImageElement
(en-US)를 생성할 때 사용합니다. Option
(en-US)-
HTMLOptionElement
를 생성할 때 사용합니다. Window.StaticRange
(en-US) Experimental 읽기 전용-
StaticRange
(en-US) 객체를 생성하는StaticRange()
(en-US) 생성자를 반환합니다. Worker
-
Web Worker 생성에 사용합니다.
Window.XMLSerializer
-
DOM 트리를 XML 또는 HTML 소스로 변환합니다.
속성
EventTarget
의 속성을 상속하고, WindowOrWorkerGlobalScope
와 WindowEventHandlers
믹스인의 속성을 구현합니다.
Window.closed
읽기 전용-
현재 창이 닫혔는지 나타냅니다.
Window.console
읽기 전용-
브라우저 디버깅 콘솔에 접근할 수 있는 콘솔 객체를 반환합니다.
Window.controllers
읽기 전용 비표준-
현재 크롬 창의 XUL 컨트롤러 객체를 반환합니다.
Window.customElements
읽기 전용-
새로운 사용자 지정 요소를 등록하거나, 이전에 등록한 요소에 대한 정보를 얻을 수 있는
CustomElementRegistry
객체를 반환합니다. Window.crypto
읽기 전용-
브라우저 암호화 객체를 반환합니다.
Window.devicePixelRatio
읽기 전용-
현재 화면에서의 물리적 픽셀과 CSS 픽셀의 비율을 반환합니다.
Window.document
읽기 전용-
창이 포함하는 문서로의 참조를 반환합니다.
Window.DOMMatrix
읽기 전용 Experimental-
Returns a reference to a
DOMMatrix
(en-US) object, which represents 4x4 matrices, suitable for 2D and 3D operations. Window.DOMMatrixReadOnly
읽기 전용 Experimental-
Returns a reference to a
DOMMatrixReadOnly
(en-US) object, which represents 4x4 matrices, suitable for 2D and 3D operations. Window.DOMPoint
읽기 전용 Experimental-
Returns a reference to a
DOMPoint
(en-US) object, which represents a 2D or 3D point in a coordinate system. Window.DOMPointReadOnly
읽기 전용 Experimental-
Returns a reference to a
DOMPointReadOnly
(en-US) object, which represents a 2D or 3D point in a coordinate system. Window.DOMQuad
읽기 전용 Experimental-
Returns a reference to a
DOMQuad
(en-US) object, which provides represents a quadrilaterial object, that is one having four corners and four sides. Window.DOMRect
읽기 전용 Experimental-
Returns a reference to a
DOMRect
object, which represents a rectangle. Window.DOMRectReadOnly
읽기 전용 Experimental-
Returns a reference to a
DOMRectReadOnly
(en-US) object, which represents a rectangle. Window.event
읽기 전용-
Returns the current event, which is the event currently being handled by the JavaScript code's context, or
undefined
if no event is currently being handled. TheEvent
object passed directly to event handlers should be used instead whenever possible. Window.frameElement
읽기 전용-
이 창을 삽입했을 때 사용한 요소를 반환합니다. 창이 문서 내에 삽입된 것이 아니면
null
을 반환합니다. Window.frames
(en-US) 읽기 전용-
현재 창의 하위 프레임을 배열로 반환합니다.
Window.fullScreen
(en-US)-
현재 창을 전체 화면으로 보여주고 있는지 나타냅니다.
Window.history
읽기 전용-
Returns a reference to the history object.
Window.innerHeight
읽기 전용-
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
Window.innerWidth
읽기 전용-
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
Window.isSecureContext
Experimental 읽기 전용-
Indicates whether a context is capable of using features that require secure contexts.
Window.length
읽기 전용-
Returns the number of frames in the window. See also
window.frames
(en-US). Window.location
-
Gets/sets the location, or current URL, of the window object.
Window.locationbar
(en-US) 읽기 전용-
Returns the locationbar object, whose visibility can be toggled in the window.
Window.localStorage
읽기 전용-
Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
-
Returns the menubar object, whose visibility can be toggled in the window.
Window.messageManager
-
Returns the message manager object for this window.
Window.mozInnerScreenX
(en-US) 읽기 전용 비표준-
Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See
mozScreenPixelsPerCSSPixel
innsIDOMWindowUtils
for a conversion factor to adapt to screen pixels if needed. Window.mozInnerScreenY
(en-US) 읽기 전용 비표준-
Returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See
mozScreenPixelsPerCSSPixel
for a conversion factor to adapt to screen pixels if needed. Window.name
-
Gets/sets the name of the window.
-
Returns a reference to the navigator object.
Window.opener
-
현재 창을 열었던 다른 창의 참조를 반환합니다.
Window.outerHeight
(en-US) 읽기 전용-
브라우저 창 외곽 높이를 반환합니다.
Window.outerWidth
읽기 전용-
브라우저 창 외곽 너비를 반환합니다.
Window.pageXOffset
읽기 전용-
An alias for
window.scrollX
. Window.pageYOffset
읽기 전용-
An alias for
window.scrollY
Window.parent
(en-US) 읽기 전용-
Returns a reference to the parent of the current window or subframe.
Window.performance
(en-US) 읽기 전용-
Returns a
Performance
object, which includes thetiming
(en-US) andnavigation
(en-US) attributes, each of which is an object providing performance-related data. See also Using Navigation Timing (en-US) for additional information and examples. Window.personalbar
(en-US) 읽기 전용-
Returns the personalbar object, whose visibility can be toggled in the window.
Window.screen
(en-US) 읽기 전용-
Returns a reference to the screen object associated with the window.
Window.screenX
(en-US) andWindow.screenLeft
(en-US) 읽기 전용-
Both properties return the horizontal distance from the left border of the user's browser viewport to the left side of the screen.
Window.screenY
(en-US) andWindow.screenTop
(en-US) 읽기 전용-
Both properties return the vertical distance from the top border of the user's browser viewport to the top side of the screen.
Window.scrollbars
(en-US) 읽기 전용-
Returns the scrollbars object, whose visibility can be toggled in the window.
Window.scrollMaxX
(en-US) 비표준 읽기 전용-
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
Window.scrollMaxY
(en-US) 비표준 읽기 전용-
The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
Window.scrollX
읽기 전용-
Returns the number of pixels that the document has already been scrolled horizontally.
Window.scrollY
읽기 전용-
Returns the number of pixels that the document has already been scrolled vertically.
Window.self
읽기 전용-
Returns an object reference to the window object itself.
Window.sessionStorage
-
Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
-
Returns a reference to the window object of the sidebar.
Window.speechSynthesis
(en-US) 읽기 전용-
Returns a
SpeechSynthesis
(en-US) object, which is the entry point into using Web Speech API (en-US) speech synthesis functionality. Window.status
-
Gets/sets the text in the statusbar at the bottom of the browser.
Window.statusbar
(en-US) 읽기 전용-
Returns the statusbar object, whose visibility can be toggled in the window.
Window.toolbar
읽기 전용-
Returns the toolbar object, whose visibility can be toggled in the window.
Window.top
읽기 전용-
Returns a reference to the topmost window in the window hierarchy. This property is read only.
Window.visualViewport
(en-US) 읽기 전용-
Returns a
VisualViewport
(en-US) object which represents the visual viewport for a given window. Window.window
읽기 전용-
Returns a reference to the current window.
window[0]
,window[1]
, etc.-
Returns a reference to the
window
object in the frames. SeeWindow.frames
(en-US) for more details.
Properties implemented from elsewhere
WindowOrWorkerGlobalScope.caches
(en-US) 읽기 전용-
Returns the
CacheStorage
(en-US) object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests. WindowOrWorkerGlobalScope.indexedDB
(en-US) 읽기 전용-
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an
IDBFactory
(en-US) object. WindowOrWorkerGlobalScope.isSecureContext
(en-US) 읽기 전용-
Returns a boolean indicating whether the current context is secure (
true
) or not (false
). WindowOrWorkerGlobalScope.origin
(en-US) 읽기 전용-
Returns the global object's origin, serialized as a string. (This does not yet appear to be implemented in any browser.)
메서드
EventTarget
의 메서드를 상속하고, WindowOrWorkerGlobalScope
와 WindowEventHandlers
믹스인의 메서드를 구현합니다.
Window.alert()
-
경고 대화 상자를 표시합니다.
Window.blur()
(en-US)-
Sets focus away from the window.
Window.cancelAnimationFrame()
Experimental-
Enables you to cancel a callback previously scheduled with
Window.requestAnimationFrame
. Window.cancelIdleCallback()
(en-US) Experimental-
Enables you to cancel a callback previously scheduled with
Window.requestIdleCallback
. Window.clearImmediate()
(en-US)-
Cancels the repeated execution set using
setImmediate
. Window.close()
(en-US)-
Closes the current window.
Window.confirm()
-
Displays a dialog with a message that the user needs to respond to.
Window.dispatchEvent()
-
Used to trigger an event.
Window.dump()
(en-US) 비표준-
Writes a message to the console.
Window.find()
(en-US)-
Searches for a given string in a window.
Window.focus()
(en-US)-
Sets focus on the current window.
Window.getComputedStyle()
-
Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
Window.getDefaultComputedStyle()
(en-US) 비표준-
Gets default computed style for the specified element, ignoring author stylesheets.
Window.getSelection()
-
Returns the selection object representing the selected item(s).
Window.matchMedia()
-
Returns a
MediaQueryList
(en-US) object representing the specified media query string. Window.maximize()
- {{todo("NeedsContents")}}
Window.minimize()
(en-US) (top-level XUL windows only)-
Minimizes the window.
Window.moveBy()
(en-US)-
Moves the current window by a specified amount.
Window.moveTo()
(en-US)-
Moves the window to the specified coordinates.
Window.open()
(en-US)-
Opens a new window.
Window.postMessage()
-
Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
Window.print()
(en-US)-
Opens the Print Dialog to print the current document.
Window.prompt()
-
Returns the text entered by the user in a prompt dialog.
Window.requestAnimationFrame()
-
Tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
Window.requestIdleCallback()
Experimental-
Enables the scheduling of tasks during a browser's idle periods.
Window.resizeBy()
(en-US)-
Resizes the current window by a certain amount.
Window.resizeTo()
-
Dynamically resizes window.
Window.scroll()
-
Scrolls the window to a particular place in the document.
Window.scrollBy()
-
Scrolls the document in the window by the given amount.
Window.scrollByLines()
(en-US) 비표준-
Scrolls the document by the given number of lines.
Window.scrollByPages()
(en-US) 비표준-
Scrolls the current document by the specified number of pages.
Window.scrollTo()
-
Scrolls to a particular set of coordinates in the document.
Window.setCursor()
비표준 (top-level XUL windows only)-
Changes the cursor for the current window
Window.setImmediate()
(en-US)-
Executes a function after the browser has finished other heavy tasks
Window.setResizable()
비표준-
Toggles a user's ability to resize a window.
Window.sizeToContent()
(en-US) 비표준-
Sizes the window according to its content.
Window.stop()
-
This method stops window loading.
Window.updateCommands()
(en-US) 비표준-
Updates the state of commands of the current chrome window (UI).
Methods implemented from elsewhere
EventTarget.addEventListener()
-
Register an event handler to a specific event type on the window.
WindowOrWorkerGlobalScope.atob()
(en-US)-
Decodes a string of data which has been encoded using base-64 encoding.
WindowOrWorkerGlobalScope.btoa()
(en-US)-
Creates a base-64 encoded ASCII string from a string of binary data.
WindowOrWorkerGlobalScope.clearInterval()
(en-US)-
Cancels the repeated execution set using
WindowOrWorkerGlobalScope.setInterval()
(en-US). WindowOrWorkerGlobalScope.clearTimeout()
(en-US)-
Cancels the delayed execution set using
WindowOrWorkerGlobalScope.setTimeout()
. WindowOrWorkerGlobalScope.createImageBitmap()
(en-US)-
Accepts a variety of different image sources, and returns a
Promise
(en-US) which resolves to anImageBitmap
(en-US). Optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. WindowOrWorkerGlobalScope.fetch()
(en-US)-
Starts the process of fetching a resource from the network.
EventTarget.removeEventListener
-
Removes an event listener from the window.
WindowOrWorkerGlobalScope.setInterval()
(en-US)-
Schedules a function to execute every time a given number of milliseconds elapses.
WindowOrWorkerGlobalScope.setTimeout()
-
Schedules a function to execute in a given amount of time.
이벤트 처리기
These are properties of the window object that can be set to establish event handlers for the various things that can happen in the window that might be of interest.
This interface inherits event handlers from the EventTarget
interface and implements event handlers from WindowEventHandlers
.
Window.onappinstalled
(en-US)-
Called when the page is installed as a webapp. See
appinstalled
event. Window.onbeforeinstallprompt
(en-US)-
An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile.
Window.ondevicelight
-
An event handler property for any ambient light levels changes
Window.ondevicemotion
(en-US)-
Called if accelerometer detects a change (For mobile devices)
Window.ondeviceorientation
(en-US)-
Called when the orientation is changed (For mobile devices)
Window.ondeviceorientationabsolute
(en-US) 비표준-
An event handler property for any device orientation changes.
Window.ondeviceproximity
(en-US)-
An event handler property for device proximity event
Window.ongamepadconnected
(en-US)-
Represents an event handler that will run when a gamepad is connected (when the
gamepadconnected (en-US)
event fires). Window.ongamepaddisconnected
(en-US)-
Represents an event handler that will run when a gamepad is disconnected (when the
gamepaddisconnected (en-US)
event fires). Window.onmozbeforepaint
-
An event handler property for the
MozBeforePaint
event, which is sent before repainting the window if the event has been requested by a call to theWindow.mozRequestAnimationFrame()
(en-US) method. Window.onpaint
-
An event handler property for paint events on the window.
Window.onrejectionhandled
(en-US) Experimental-
An event handler for handled
Promise
rejection events. Window.onuserproximity
(en-US)-
An event handler property for user proximity events.
Window.onvrdisplayconnect
(en-US)-
Represents an event handler that will run when a compatible VR device has been connected to the computer (when the
vrdisplayconnected
event fires). Window.onvrdisplaydisconnect
(en-US)-
Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the
vrdisplaydisconnected
event fires). Window.onvrdisplayactivate
(en-US)-
Represents an event handler that will run when a display is able to be presented to (when the
vrdisplayactivate
event fires), for example if an HMD has been moved to bring it out of standby, or woken up by being put on. Window.onvrdisplaydeactivate
(en-US)-
Represents an event handler that will run when a display can no longer be presented to (when the
vrdisplaydeactivate
event fires), for example if an HMD has gone into standby or sleep mode due to a period of inactivity. Window.onvrdisplayblur
(en-US)-
Represents an event handler that will run when presentation to a display has been paused for some reason by the browser, OS, or VR hardware (when the
vrdisplayblur
event fires) — for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience. Window.onvrdisplayfocus
(en-US)-
Represents an event handler that will run when presentation to a display has resumed after being blurred (when the
vrdisplayfocus
event fires). Window.onvrdisplaypresentchange
(en-US)-
represents an event handler that will run when the presenting state of a VR device changes — i.e. goes from presenting to not presenting, or vice versa (when the
vrdisplaypresentchange
event fires).
Event handlers implemented from elsewhere
GlobalEventHandlers.onabort
(en-US)-
Called when the loading of a resource has been aborted, such as by a user canceling the load while it is still in progress
WindowEventHandlers.onafterprint
(en-US)-
Called when the print dialog box is closed. See
afterprint (en-US)
event. WindowEventHandlers.onbeforeprint
(en-US)-
Called when the print dialog box is opened. See
beforeprint (en-US)
event. WindowEventHandlers.onbeforeunload
(en-US)-
An event handler property for before-unload events on the window.
GlobalEventHandlers.onblur
(en-US)-
Called after the window loses focus, such as due to a popup.
GlobalEventHandlers.onchange
-
An event handler property for change events on the window.
GlobalEventHandlers.onclick
(en-US)-
Called after the ANY mouse button is pressed & released
GlobalEventHandlers.ondblclick
-
Called when a double click is made with ANY mouse button.
GlobalEventHandlers.onclose
(en-US)-
Called after the window is closed
-
Called when the RIGHT mouse button is pressed
GlobalEventHandlers.onerror
(en-US)-
Called when a resource fails to load OR when an error occurs at runtime. See
error (en-US)
event. GlobalEventHandlers.onfocus
(en-US)-
Called after the window receives or regains focus. See
focus (en-US)
events. WindowEventHandlers.onhashchange
-
An event handler property for
hashchange (en-US)
events on the window; called when the part of the URL after the hash mark ("#") changes. GlobalEventHandlers.oninput
(en-US)-
Called when the value of an <input> element changes
GlobalEventHandlers.onkeydown
(en-US)-
Called when you begin pressing ANY key. See
keydown
event. GlobalEventHandlers.onkeypress
(en-US)-
Called when a key (except Shift, Fn, and CapsLock) is in pressed position. See
keypress (en-US)
event. GlobalEventHandlers.onkeyup
(en-US)-
Called when you finish releasing ANY key. See
keyup (en-US)
event. WindowEventHandlers.onlanguagechange
(en-US)-
An event handler property for
languagechange (en-US)
events on the window. GlobalEventHandlers.onload
(en-US)-
Called after all resources and the DOM are fully loaded. WILL NOT get called when the page is loaded from cache, such as with back button.
WindowEventHandlers.onmessage
(en-US)-
Is an
event handler
representing the code to be called when themessage
event is raised. GlobalEventHandlers.onmousedown
(en-US)-
Called when ANY mouse button is pressed.
GlobalEventHandlers.onmousemove
(en-US)-
Called continously when the mouse is moved inside the window.
GlobalEventHandlers.onmouseout
(en-US)-
Called when the pointer leaves the window.
GlobalEventHandlers.onmouseover
(en-US)-
Called when the pointer enters the window
GlobalEventHandlers.onmouseup
(en-US)-
Called when ANY mouse button is released
WindowEventHandlers.onoffline
-
Called when network connection is lost. See
offline (en-US)
event. WindowEventHandlers.ononline
-
Called when network connection is established. See
online (en-US)
event. WindowEventHandlers.onpagehide
-
Called when the user navigates away from the page, before the onunload event. See
pagehide (en-US)
event. WindowEventHandlers.onpageshow
-
Called after all resources and the DOM are fully loaded. See
pageshow (en-US)
event. WindowEventHandlers.onpopstate
-
Called when a back button is pressed.
GlobalEventHandlers.onreset
(en-US)-
Called when a form is reset
GlobalEventHandlers.onresize
(en-US)-
Called continuously as you are resizing the window.
GlobalEventHandlers.onscroll
-
Called when the scroll bar is moved via ANY means. If the resource fully fits in the window, then this event cannot be invoked
GlobalEventHandlers.onwheel
(en-US)-
Called when the mouse wheel is rotated around any axis
GlobalEventHandlers.onselect
(en-US)-
Called after text in an input field is selected
GlobalEventHandlers.onselectionchange
(en-US)-
Is an
event handler
representing the code to be called when theselectionchange
event is raised. WindowEventHandlers.onstorage
-
Called when there is a change in session storage or local storage. See
storage (en-US)
event GlobalEventHandlers.onsubmit
-
Called when a form is submitted
WindowEventHandlers.onunhandledrejection
(en-US) Experimental-
An event handler for unhandled
Promise
rejection events. WindowEventHandlers.onunload
(en-US)-
Called when the user navigates away from the page.
이벤트
Listen to these events using addEventListener()
or by assigning an event listener to the oneventname
property of this interface.
error
(en-US)-
Fired when when a resource failed to load, or can't be used. For example, if a script has an execution error or an image can't be found or is invalid. Also available via the
onerror
(en-US) property. languagechange
(en-US)-
Fired at the global scope object when the user's preferred language changes. Also available via the
onlanguagechange
property. orientationchange
-
Fired when the orientation of the device has changed. Also available via the
onorientationchange
property. devicemotion
(en-US)-
Fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate of rotation, if available.
deviceorientation
(en-US)-
Fired when fresh data is available from the magnetometer orientation sensor about the current orientation of the device as compared to the Earth coordinate frame.
resize
-
Fired when the window has been resized. Also available via the
onresize
property. storage
(en-US)-
Fired when a storage area (
localStorage
orsessionStorage
) has been modified in the context of another document. Also available via theonstorage
property.
Animation events
animationcancel
(en-US)-
Fired when an animation unexpectedly aborts. Also available via the
onanimationcancel
property. animationend
(en-US)-
Fired when an animation has completed normally. Also available via the
onanimationend
property. animationiteration
(en-US)-
Fired when an animation iteration has completed. Also available via the
onanimationiteration
property. animationstart
(en-US)-
Fired when an animation starts. Also available via the
onanimationstart
property.
Clipboard events
clipboardchange
-
Fired when the system clipboard content changes.
copy
-
Fired when the user initiates a copy action through the browser's user interface. Also available via the
oncopy
(en-US) property. cut
-
Fired when the user initiates a cut action through the browser's user interface. Also available via the
oncut
(en-US) property. paste
-
Fired when the user initiates a paste action through the browser's user interface. Also available via the
onpaste
(en-US) property.
Connection events
offline
(en-US)-
Fired when the browser has lost access to the network and the value of
navigator.onLine
has switched tofalse
. Also available via theonoffline
property. online
(en-US)-
Fired when the browser has gained access to the network and the value of
navigator.onLine
has switched totrue
. Also available via theononline
property.
Focus events
blur
(en-US)-
Fired when an element has lost focus. Also available via the
onblur
(en-US) property. focus
(en-US)-
Fired when an element has gained focus. Also available via the
onfocus
(en-US) property
Gamepad events
gamepadconnected
(en-US)-
Fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used. Also available via the
ongamepadconnected
property. gamepaddisconnected
(en-US)-
Fired when the browser detects that a gamepad has been disconnected. Also available via the
ongamepaddisconnected
property
History events
hashchange
-
Fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the
#
symbol). Also available via theonhashchange
property. pagehide
(en-US)-
Sent when the browser hides the current document while in the process of switching to displaying in its place a different document from the session's history. This happens, for example, when the user clicks the Back button or when they click the Forward button to move ahead in session history. Also available through the
onpagehide
event handler property. pageshow
(en-US)-
Sent when the browser makes the document visible due to navigation tasks, including not only when the page is first loaded, but also situations such as the user navigating back to the page after having navigated to another within the same tab. Also available using the
onpageshow
event handler property. popstate
-
Fired when the active history entry changes. Also available using the
onpopstate
event handler property.
Load & unload events
beforeunload
-
Fired when the window, the document and its resources are about to be unloaded. Also available via the
onbeforeunload
(en-US) property. DOMContentLoaded
-
Fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
load
-
Fired when the whole page has loaded, including all dependent resources such as stylesheets images. Also available via the
onload
(en-US) property. unload
-
Fired when the document or a child resource is being unloaded. Also available via the
onunload
(en-US) property.
Manifest events
appinstalled
(en-US)-
Fired when the browser has successfully installed a page as an application. Also available via the
onappinstalled
(en-US) property. beforeinstallprompt
(en-US)-
Fired when a user is about to be prompted to install a web application. Also available via the
onbeforeinstallprompt
(en-US) property.
Messaging events
message
(en-US)-
Fired when the window receives a message, for example from a call to
Window.postMessage()
from another browsing context. Also available via theonmessage
(en-US) property. messageerror
(en-US)-
Fired when a
Window
object receives a message that can't be deserialized. Also available via theonmessageerror
(en-US) property.
Print events
afterprint
(en-US)-
Fired after the associated document has started printing or the print preview has been closed. Also available via the
onafterprint
(en-US) property. beforeprint
(en-US)-
Fired when the associated document is about to be printed or previewed for printing. Also available via the
onbeforeprint
(en-US) property.
Promise rejection events
rejectionhandled
(en-US)-
Sent every time a JavaScript
Promise
is rejected, regardless of whether or not there is a handler in place to catch the rejection. Also available through theonrejectionhandled
event handler property. unhandledrejection
(en-US)-
Sent when a JavaScript
Promise
is rejected but there is no handler in place to catch the rejection. Also available using theonunhandledrejection
event handler property.
Transition events
transitioncancel
(en-US)-
Fired when a CSS transition (en-US) is canceled. Also available via the
ontransitioncancel
property. transitionend
(en-US)-
Fired when a CSS transition (en-US) has completed. Also available via the
ontransitionend
property. transitionrun
(en-US)-
Fired when a CSS transition (en-US) is first created. Also available via the
ontransitionrun
property. transitionstart
(en-US)-
Fired when a CSS transition (en-US) has actually started. Also available via the
ontransitionstart
property.
WebVR events
vrdisplayactivate
(en-US)-
Fired when a VR display becomes available to be presented to, for example if an HMD has been moved to bring it out of standby, or woken up by being put on. Also available via the
onvrdisplayactivate
(en-US) property. vrdisplayblur
(en-US)-
Fired when presentation to a VR display has been paused for some reason by the browser, OS, or VR hardware. Also available via the
onvrdisplayblur
(en-US) property. vrdisplayconnect
(en-US)-
Fired when a compatible VR display is connected to the computer. Also available via the
onvrdisplayconnect
(en-US) property. vrdisplaydeactivate
(en-US)-
Fired when a VR display can no longer be presented to, for example if an HMD has gone into standby or sleep mode due to a period of inactivity. Also available via the
onvrdisplaydeactivate
(en-US) property. vrdisplaydisconnect
(en-US)-
Fired when a compatible VR display is disconnected from the computer. Also available via the
onvrdisplaydisconnect
(en-US) property. vrdisplayfocus
(en-US)-
Fired when presentation to a VR display has resumed after being blurred. Also available via the
onvrdisplayfocus
(en-US) property. vrdisplaypresentchange
(en-US)-
Fired when the presenting state of a VR display changes — i.e. goes from presenting to not presenting, or vice versa. Also available via the
onvrdisplaypresentchange
(en-US) property. vrdisplaypointerrestricted
(en-US)-
Fired when the VR display's pointer input is restricted to consumption via a pointerlocked element (en-US). Also available via the
onvrdisplaypointerrestricted
(en-US) property. vrdisplaypointerunrestricted
(en-US)-
Fired when the VR display's pointer input is no longer restricted to consumption via a pointerlocked element (en-US). Also available via the
onvrdisplaypointerunrestricted
(en-US) property.
인터페이스
DOM 인터페이스를 참고하세요.
브라우저 호환성
BCD tables only load in the browser