Main  Basic   Advanced  Download  

New Windows  

JavaScript also introduces another cool thing: new windows. New windows can be any size, be resizable or not, and have all the menus and toolbars that a normal browser window has, or none at all! It may sound complicated but in fact...

Variable = window.open("URL", "windowName" [,"windowFeatures"])

Where Variable is just the name of the variable that calls the window. This can be any variable you like. URL is the page that should open in the new window, windowName the name of the window which you can refer to in your script, like a frame name, and lastly, windowFeatures is a list of comma separated variables with the following possible values. (note: you don't have to put these in, just if you want something that isn't the default.

toolbar=yes|no
location=yes|no
directories=yes|no
status=yes|no
menubar=yes|no
scrollbars=yes|no
resizable=yes|no
width=pixels
height=pixels

ok, so here's an example:

newwindow = "window.open ('htmlind.html', 'newWin', 'scrollbars=yes,status=yes,width=300,height=300')"

Well, hope that's taught you something useful: now you'll be able to use windows more effectively in your designs.

The code for the button is:

<INPUT TYPE="button" VALUE="Click for Result" ONCLICK="window.open ('htmlind.html', 'newWin', 'scrollbars=yes,status=yes,width=300,height=300')">

 

Copyright 1998 Iceman. All Rights Reserved. Further Legal Stuff

This page hosted by Get your own Free Home Page