Ii. Basic Syntax:
VaR win = Window. Open (pageurl, name, parameters)
Where:
Pageurl is the sub-window path
Name isSub-window handle,Win is also the window object of the subwindow. Pay attention to the difference.
Parameters is window parameters (parameters are separated by commas)
Iii. Some parameters
Here, yes/no can also use 1/0; pixel value is a specific value, in pixels.
Parameter | value range | description
|
Alwayslowered | yes/no | specifies that the window is hidden behind all windows
Alwaysraised | yes/no | specify that the window is suspended above all windows
Depended | yes/no | whether to close the parent window at the same time
Directories | yes/no | whether the directory bar of nav2 and 3 is visible
Height | pixel value | window height
Hotkeys | yes/no | set the Security Exit hotkey in the window without menu bar
Innerheight | pixel value | pixel height of the document in the window
Innerwidth | pixel value | pixel width of the document in the window
Location | yes/no | whether the location bar is visible
Menubar | yes/no | whether the menu bar is visible
Outerheight | pixel value | set the pixel height of the window (including the decorative border)
Outerwidth | pixel value | set the pixel width of the window (including the decorative border)
Resizable | yes/no | whether the window size can be adjusted
Screenx | pixel value | pixel length between the window and the left boundary of the screen
Screeny | pixel value | pixel length between the window and the upper boundary of the screen
Scrollbars | yes/no | whether the window has a scroll bar
Titlebar | yes/no | whether the title bar of the window is visible
Toolbar | yes/no | whether the toolbar of the window is visible
Width | pixel value | pixel width of the window
Z-Look | yes/no | whether the window floated above other windows after being activated
Status | yes/no whether the status bar is visible
4. Usage notes:
1. toolbar = 0 and toolbar = 'no', toolbar = 1 and toolbar = 'yes' have the same effect.
2. When both resizable = 'yes' and scrollbars = 'yes' exist, the scroll bar does not appear and must be resizable = 'no' or 0
3. When the page parameters of window. open () are changed, close the parent ie window and re-open it to see the change effect. Do they and showmodal
Like Dialog (), is it also preloaded?
Open a new window to maximize the solution:
Cause: Use window. when the open () method opens a new window, the new window maximization button cannot be used, no matter how you write it, it cannot be maximized, and the window size cannot be adjusted, the statement with the parameter resizable = Yes (NO) does not work at all.
Method 1: Add the fullscreen = "1" parameter, which is currently the best and simplest solution. Example: Win = Window. open "main.htm", "", "fullscreen = 1, toolbar = 0, location = 0, directories = 0, status = 0, menubar = 0, resizable = 0, top = 10000, Left = 10000 ");
Method 2: Use screen. availheight and screen. availwidth as the parameter values of height and width. However, screen. availheight and screen. availwidth are not full screen, but the title bar, left area, and taskbar of an existing window. Therefore, when multiple windows are opened, the new windows become smaller and smaller. It may be possible to use numerical calculations to control this reduction, but it cannot be implemented.
Example 1:
<Script language = JavaScript> <! --
VaR WW = Window. Screen. width;
VaR HH = Window. Screen. Height-20;
Window. open ("AA. ASP "," "," toolbar = No, location = No, directories = No, menubar = No, scrollbars = No, resizable = Yes, status = No, top = 0, left = 0, width = "+ WW +", Height = "+ HH );
// --> </SCRIPT>
Example 2:
How to add an event in the new window:
<Script language = JavaScript type = "text/JavaScript">
If (window. Screen ){
Window. moveTo (0, 0 );
Window. resizeTo (screen. availwidth, screen. availheight );
}
</SCRIPT>
Modified:
Function newwindow ()
{
VaR pageurl = "http: // 191.1.1.49: 8080/servletprint/printviewerservlet? Screenwidth = "+ (screen. Width-15) +" & "+" screenheight = "+ screen. height;
VaR mywin = Window. open (pageurl, "", "resizable = 'yes', status = 'yes', depended = 'yes', directories = 'no', location = 'no ', menubar = 'no', titlebar = 'yes', toolbar = 'No '");
Mywin. moveTo (0, 0 );
Mywin. resizeTo (screen. availwidth, screen. availheight );
}
A new window handle is available on the Internet, but an error is reported during the test in my environment: "Access Denied. This idea does not work. Like fullscreen, this method does not maximize the form, but has achieved the maximum effect.
However, in Maxthon, the effect is not good. The former cannot be maximized in Maxthon, because it is the maximization of the browser and the page is not maximized,
In fact, the size of the backend is full, but it is not truly maximized,
Someone uses
Window. Open ("default18.aspx", "A", "channelmode = Yes, menubar = Yes, toolbar = Yes, status = yes ");
Chanelmode to solve this problem.
However, after maximization, you cannot use resize to increase again. In addition, the taskbar of the window is covered.
Method 3: Truly maximize. Example 1:
</Object> <Object ID = "Max" type = "application/X-oleobject" classid = "CLSID: adb880a6-d8ff-11cf-9377-00aa003b7a11">
<Param name = "command" value = "maximize">
</Object>
<Input type = button value = maximized onclick = max. Click ()>
Example 2: automatically maximized code when a window is opened
<! -- Maximize when the window is opened -->
<Object ID = "Max" type = "application/X-oleobject" classid = "CLSID: adb880a6-d8ff-11cf-9377-00aa003b7a11 "> <Param name =" command "value =" maximize "> </Object>
<SCRIPT>
If (window. screenleft! = 0)
Max. Click ();
</SCRIPT>
<! -- Maximize the window after opening --> but some netizens say this stuff is invalid in ASP. net2.0. I don't know if it is.
Method 4: To maximize the window in the new window, the JS implementation method already has several methods. Next, we will introduce a method.
This. windowstate = maximized!
Three statuses: maximized! Minimized! Normal!
You can add the following command in the resize event of the opened window:
This. windowstate = maximized!
Or
Add the following command to the open or activate event of the opened window:
This. windowstate = maximized!