Page 161 - JavaScript
P. 161

•  Document: represents current web page.
            •  History: represents pages in browser history.
            •  Location: represents URL of current page.
            •  Navigator: represents information about browser.
            •  Screen: represents device's display information.


        Window Object Methods


        The most important object in the Browser Object Model is the window object. It helps in accessing
        information about the browser and its components. To access these features, it has various
        methods and properties.


          Method                          Description


          window.alert()                  Creates dialog box with message and an OK button


          window.blur()                   Remove focus from window

          window.close()                  Closes a browser window


                                          Creates dialog box with message, an OK button and a cancel
          window.confirm()
                                          button

          window.getComputedStyle()       Get CSS styles applied to an element


          window.moveTo(x,y)              Move a window's left and top edge to supplied coordinates


          window.open()                   Opens new browser window with URL specified as parameter

          window.print()                  Tells browser that user wants to print contents of current page


          window.prompt()                 Creates dialog box for retrieving user input

          window.scrollBy()               Scrolls the document by the specified number of pixels


          window.scrollTo()               Scrolls the document to the specified coordinates


          window.setInterval()            Do something repeatedly at specified intervals

          window.setTimeout()             Do something after a specified amount of time


          window.stop()                   Stop window from loading



        Window Object Properties


        The Window Object contains the following properties.








        https://riptutorial.com/                                                                             118
   156   157   158   159   160   161   162   163   164   165   166