Thewindow.open()function creates a new browser window, customized to your specifications, without the use of an HTML anchor tag. In this example, we will be making a function that utilizes thewindow.open()function.
There are three arguments that thewindow.openfunction takes:
- The relative or absolute URL of the webpage to be opened.
- The text name for the window.
- A long string that contains all the different properties of the window.
- dependent– Subwindow closes if the parent window (the window that opened it) closes
- fullscreen– Display browser in fullscreen mode
- height– The height of the new window, in pixels
- width– The width of the new window, in pixels
- left– Pixel offset from the left side of the screen
- top– Pixel offset from the top of the screen
- resizable– Allow the user to resize the window or prevent the user from resizing, currently broken in Firefox.
- status– Display or don’t display the status bar
Dependent, fullscreen, resizable, and status are all examples of ON/OFF properties. You can either set them equal to zero to turn them off, or set them to one to turn them ON. There is no inbetween setting for these types of properties.
Now, that is a prime example of a worthless popup! When you make your own, try to have them relate to your content, like a small popup with no navigation that just gives the definition or explanation of a word, sentence, or picture!