Specifying Size When Launching New Browser Window

Peter Farris pfarris at email.njin.net
Fri Jan 23 16:17:23 EST 1998


This is a two-part answer. To do this via Javascript, you have to define a
function in the <HEADER>, and then specify your link in the body. An
example:

<HEAD>

<SCRIPT LANGUAGE="Javascript">
   <!--
function openWin(URL) {
aWindow=window.open(URL,"thewindow","SCROLLBARS=NO,STATUS=NO,RESIZE=NO,WIDTH=550,HEIGHT=250");
}
   //  -->
</SCRIPT>

</HEAD>

<BODY>

<SCRIPT LANGUAGE = "Javascript">
   <!--
<A HREF="javascript:openWin('yourURL.htm');">Click Here</A>
   // -->
</SCRIPT>

Make sure all the quotes are as shown, and make your own decision as to
height, width, scrollbars, etc.

On Fri, 23 Jan 1998, Linda Absher wrote:
> I've searched the archives without success:  I have a frame-based web site
> listing various web-based databases.  What I want to do is have a new
> browser window to launch when clicking on a database; however, I'd like to
> be able to dictate the _size_ of the window once it's launched.  I suspect
> I'll have to use a javascript, but I'm wondering if there's a way to do it
> in the TARGET tag.

Peter Farris / pfarris at email.njin.net
Electronic Services Librarian, Potter Library
Ramapo College, Mahwah, NJ 07430
vox: 201.529.6673 / fax: 201.529.7628



More information about the Web4lib mailing list