Example: Create a new window using JavaScript

You can use JavaScript to launch a new window (an instance of Internet Explorer). The code in this example can be used on both standard Web pages and within compiled help (.chm) files.

Create the link as follows:


<A HREF= "#" onClick="window.open('examples/sample.htm',

'Sample','toolbar=no,width=190,height=190,left=500,top=200,
status=no,scrollbars=no,resize=no');return false">
See the sample</A>.

where examples/sample.htm is the path to the file that will appear in the new window, Sample is the name argument for the new window, and the remaining values are the attributes for the pop-up window (width and height in pixels, toolbar, scroll bar, status bar, and resize). These attributes are separated by commas, and the entire line is enclosed in single quotes.

Notes


link to overview topic About the script and DHTML examples