By now you should be a dab hand at creating links. If you've followed our tutorials you should be able to create links that open in a new window using target="_blank"
However many sites have links to windows that open to a predetermined size, with or without controls or pop up (these popup window are called floating palettes and can be useful or can be a damn pain!!)
Lets begin with a simple example. Click on the form button below and another palette opens
Notice how there is no scrollbar or menu controls. You can't adjust the size of the box either.
Technically you need to do this
Luckily both Internet Explorer and Netscape recognise no(0) as a default. (toolbar to directories set various menu bars, then status sets the status bar at the bottom of the window. The scrollbar and resize are self explanatory we hope !!!)
Make sure you don't put in extra spaces
Substitute your own target URL (we use test.htm here) and change the options as described earlier. You can also replace anythingyouwant, test.htm and newwindow with any values you want.
(We describe how to close down windows elsewhere)
A slight variation on this theme allowed you to have a window pop up on loading
To do this we added the onLoad attribute to the <body> tag
The onLoad attribute tells the browser to do the following when the HTML document loads up
Here onLoad tells the browser to open a window for the URL (defined here as the file nav.htm) which the browser then knows as a window called navwindow (you can use your own name).
Okay !! That's the basics !!
But how about adding it to a more ordinary link item like a graphic or text
or click here
So how did we do it. Here is the code for the <a> tag used for both
<a href="test.htm" target="newwin"
(note the ,'', after window.open(