|
|
|||||||||||
|
|
Advanced Methods | Opening Windows |
|
|
|
|||||||
|
Opening New Browser Windows
Doing It with HTML
But you can make a
link
open in a different window.
In this case we've used: There are a few special, reserved, names: e.g.
_parent is the window that opened the current window (if it exists)
Doing It with Javascript
-- Pros and Cons of this Approach: A lot more control over the characteristics of the new window, but not as easy as letting HTML open the new window.
For example, click this
link.
The HTML code in this case is:
Let's consider some noteworthy features of this link:
3. The arguments of the function call of launch let you specify i) the file to be loaded in the new window ii) the name of the new window iii) the width of the new window iv) the height of the new window. 4) The definition of the launch function specifies other characteristics of the new window: no toolbar, no menubar, is resizable, etc.
Now let's use the launch function again to open the same file in a different sized window:
click this
link.
In this case the anchor tag is:
We can also open a new window that has more decoration. For example, let's have the new
window show the menu bar, the location (URL) of the file opened in the window, and
let's make the new window scrollable and resizable:
click this
link.
Now we've used this HTML for the link: In this case we've used a Javascript function named locscrollmenu, instead of launch. Note that both locscrollmenu and launch are Javascript functions that we defined in terms of the built-in Javascript command window.open. (The basic diffences in the definitions of the two functions are the specifications of whether or not the resultant windows will have a menu bar, scroll bar, be resizable, be scrollable, etc.)
Here's a longer page (just to show the window really is scrollable).
|
|||||||||||
|
|
|||||||||||