10
The Window http://www.functionx.com/javascript/Lesson08.htm To create a new window object, which corresponds to opening a new instance of the browser, you can call the window.open() method. Its syntax is: NewWindow = window.open([WebPage], [WndName], [Options], [Replace]) If you plan to refer to the newly created window in another section of your code, you should give it a name when creating it. To do this, pass a second argument as string. Here is an example: <input type="button" name="btnNewWindow" value="Open FunctionX JavaScript in a New Window" onClick="window.open('http://www.functionx.com/javascript', 'wndNew');" > Instead of a formal name, you can specify some options about the existing window (that creates the new window) and the new window. For example, if you want the new window to be empty, you can pass the second argument as _blank: <input type="button" name="btnNewWindow" value="Open FunctionX JavaScript in a New Window" onClick="window.open('http://www.functionx.com/javascript', '_blank');" > If you only want to replace the contents of the current window with the content of the first argument, you can pass the second argument as _self: <input type="button" name="btnNewWindow" value="Open FunctionX JavaScript in a New Window" onClick="window.open('http://www.functionx.com/javascript', '_self');" JavaScript RegExpressions http://www.regular-expressions.info/reference.html Any character except [\^$.|?*+ () All characters except the listed special characters match a single instance of a matches a

The Window

Embed Size (px)

DESCRIPTION

read it

Citation preview

The Windowhttp://www.functionx.com/javascript/Lesson08.htm

To create a new window object, which corresponds to opening a new instance of the browser, you can call thewindow.open()method. Its syntax is:NewWindow = window.open([WebPage], [WndName], [Options], [Replace])If you plan to refer to the newly created window in another section of your code, you should give it a name when creating it. To do this, pass a second argument as string. Here is an example:

Instead of a formal name, you can specify some options about the existing window (that creates the new window) and the new window. For example, if you want the new window to be empty, you can pass the second argument as_blank:

If you only want to replace the contents of the current window with the content of the first argument, you can pass the second argument as_self: