日期:2009-01-18  浏览次数:21005 次

open method (window object)<br>
Opens a new web browser window. <br>
<br>

语法<br>
[windowVar = ][window].open(&quot;URL&quot;, &quot;windowName&quot;, [&quot;windowFeatures&quot;])<br>
<br>
windowVar is the name of a new window. Use this variable when referring to a window's properties, methods, and containership. <br>
URL specifies the URL to open in the new window. See the location object for a description of the URL components. <br>
windowName is the window name to use in the TARGET attribute of a &lt;FORM&gt; or &lt;A&gt; tag. windowName can contain only alphanumeric or underscore (_) characters. <br>
windowFeatures is a comma-separated list of any of the following options and values: <br>
<br>
&nbsp;&nbsp;&nbsp;toolbar[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;location[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;directories[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;status[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;menubar[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;scrollbars[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;resizable[=yes|no]|[=1|0]<br>
&nbsp;&nbsp;&nbsp;width=pixels<br>
&nbsp;&nbsp;&nbsp;height=pixels<br>
<br>
You may use any subset of these options. Separate options with a comma. Do not put spaces between the options. <br>
<br>
pixels is a positive integer specifying the dimension in pixels. <br>
<br>
Method of<br>
window <br>
<br>
Description<br>
The open method opens a new web browser window on the client, similar to choosing New Web Browser from the File menu of the Navigator. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created. <br>
<br>
In event handlers, you must specify window.open() instead of simply using open(). Due to the scoping of static objects in JavaScript, a call to open() without specifying an object name is equivalent to document.open(). <br>
<br>
windowFeatures is an optional, comma-separated list of options for the new window. The boolean windowFeatures options are set to true if they are specified without values, or as yes or 1. For example, open(&quot;&quot;, &quot;messageWindow&quot;, &quot;toolbar&quot;) and open(&quot;&quot;, &quot;messageWindow&quot;, &quot;toolbar=1&quot;) both set the toolbar option to true. If windowName does not specify an existing window and you do not specify windowFeatures, all boolean windowFeatures are true by default. If you specify any item in windowFeatures, all other Boolean windowFeatures are false unless you explicitly specify them. <br>
<br>
Following is a description of the windowFeatures: <br>
<br>
toolbar creates the standard Navigator toolbar, with buttons such as &quot;Back&quot; and &quot;Forward&quot;, if true <br>
location creates a Location entry field, if true <br>
directories creates the standard Navigator directory buttons, such as &quot;What's New&quot; and &quot;What's Cool&quot;, if true <br>
status creates the status bar at the bottom of the window, if true <br>
menubar creates the menu at the top of the window, if true <br>
scrollbars creates horizontal and vertical scrollbars when the document grows larger