ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [js] Window interface
    코딩일지/TIL 2022. 6. 28. 08:24

    Window[1]

    represents a window containing a DOM document
    In a tabbed browser, each tab is represented by its own Window object


    Properties

    Window.document
    Window.navigator - reference to the navigator object.
    Window.event - event currently being handled by the JavaScript code's context, undefined if no event is handled.
    Window.location - gets current location (or current URL)
    Window.name
    Window.screen
    Window.history

    dimension

    Window.innerWidth
    Window.innerHeight

    status

    Window.closed - indicates whether it is closed.
    Window.fullscreen - indicates whether it is fullscreen.

    scrolling, position

    Window.scrollX - number of pixels document is scrolled horizontally.
    Window.scrollY - number of pixels document is scrolled vertically.
    Window.screenX, Window.screenLeft - horizontal distance from the left border of the user's browser viewport to the left side of the screen.
    Window.screenY, Window.screenTop - vertical distance from the top border of the user's browser viewport to the top side of the screen.
    Window.localStorage
    Window.sessionStorage


    methods

    Window.getSelection()
    Window.alert(message)
    Window.confirm(message)
    Window.prompt(message,default)

    Window.focus()
    Window.blur()
    Window.getComputedStyle(element)
    Window.close()

    Window.scroll(x-coord,y-coord)
    Window.scrollBy(x-coord,y-coord)
    Window.scrollTo(x-coord,y-coord)

    addEventListener()
    setInterval(func, delay)
    clearInterval(intervalID)

    setTimeout(functionRef, delay)
    clearTimeout(timeoutID)

    Window.history.back()
    Window.history.forward()

    References

    [1] Window - mozilla

    '코딩일지 > TIL' 카테고리의 다른 글

    [js] json key 추출  (0) 2022.06.30
    [js] DOMContentLoad , load event  (0) 2022.06.30
    [Linux] install package with .deb  (0) 2022.06.28
    [js] 객체의 property  (0) 2022.06.26
    [svg] svg manipulation  (0) 2022.06.26

    댓글

Designed by Tistory.