No modified pop-up window
Insert the following code into your page, will automatically pop up a window when loading, and open the Google search engine, is it very simple!
Place the code in the middle of the middle is to compatibility with the lower version of the browser, the contents within the label in a low version of the browser will be considered a gaze.
Open page uses an absolute path (
http: //) or relative path (../page.htm) can.
Sample Code 1:
Window.open ('
http://www.google.com ');
// ->
Script>
Modified pop-up window
With the following code, we can do more control, including the window size, window position, whether the toolbar is tied, can you change the size.
Sample Code 2:
VAR popupwin = 0;
Function PopupWindow ()
{
// Determine if the window has existed, if already existing, turn off the window first, then open a new window
IF (Popupwin)
{
IF (! Popupwin.closed) popupwin.close ();
}
/ / According to the display position of the pop-up window according to the parameter
Popupwin = window.open ('Page.htm', 'Popupwin', 'Toolbar = no, location = NO,
Directories = no, status = no, menub ar = no, scrollbar = no, resizable = no, copyhistory = yes, width = 100, height = 100,
Left = 100, TOP = 100, Screenx = 100, Screeny = 100 ');
}
Script>
Pop-up window parameter list
The command format of the pop-up window: "Window.Open ('urlstr', 'windowname', 'print"; ", where:
1. Window.open command is used to pop up a new window on the web.
2.urlstr: Page displayed by pop-up window
3. Windowname: The name of the pop-up window can be arbitrarily specified, or you can replace it with ''
4.Property: The properties used to control the pop-up window, the specific controlable parameters are:
5.Toolbar: Whether the browser toolbar is displayed, YES is displayed, no is not displayed
6.Location: Whether to display the audio address bar, YES is displayed, no is not displayed
7.Directories: Whether the directory button is displayed, YES is displayed, NO is not displayed
8.Status: Whether to display the status bar, YES is displayed, NO is not displayed
9.Menubar: Whether to display the menu bar, YES is displayed, NO is not displayed
10. Scrollbar: Whether to activate the horizontal and vertical flow bars, YES is displayed, NO is not displayed
11.Resizable: Can you change the size of the window, yes is displayed, NO is not displayed
12.Width: Specifies the width of the window, in pixels 13.Height: Specifies the height of the window, in pixels
14.left: Specifies the distance from the left end of the window, in pixels
15.top: Specifies the distance from the top of the window, in pixels
16.screenx: equivalent to Left attribute
17.Screeny: Is equivalent to TOP attributes