JS Browser BOM

김빛나리·2020년 7월 4일
0

1. Browser Object Model (BOM)

2. Window

  • window.open()
    • open a new window
  • window.close()
    • close the current window
  • window.moveTo()
    • move the current window
  • window.resizeTo()
    • resize the current window

3. Screen

  • screen.width
  • screen.height
  • screen.availWidth
  • screen.availHeight
  • screen.colorDepth
  • screen.pixelDepth

4. Location

  • window.location.href
    • returns the href (URL) of the current page
  • window.location.hostname
    • returns the domain name of the web host
  • window.location.pathname
    • returns the path and filename of the current page
  • window.location.protocol
    • returns the web protocol used (http: or https:)
  • window.location.assign()
    • loads a new document

5. History

  • window.history.back()
    • same as clicking back in the browser
  • window.history.forward()
    • same as clicking forward in the browser

6. Navigator

  • navigator.appName
  • navigator.appCodeName
  • navigator.platform
  • navigator.cookieEnabled
  • navigator.product
  • navigator.appVersion
  • navigator.userAgent
  • navigator.language
  • navigator.onLine
  • navigator.javaEnabled()

7. Popup Alert

  • alert("넣고싶은 말")

8. Timing

  • setTimeout(function, milliseconds)
    • Executes a function, after waiting a specified number of milliseconds.
    • myVar = setTimeout(function, milliseconds);
    • clearTimeout(myVar);
  • setInterval(function, milliseconds)
    • Same as setTimeout(), but repeats the execution of the function continuously.

9. Cookies

0개의 댓글