Earn cash for Clicks! logo

internet.com
Join the free
WDVL newsletter!

home

JavaScript Windows

The open() call takes these arguments:

  1. URL of a page to be displayed in it.
  2. The name to be given to the window.
  3. A list of properties, selected from
    • directories: yes|no
    • height: number of pixels
    • location: yes|no
    • menubar: yes|no
    • resizable: yes|no
    • scrollbars: yes|no
    • status: yes|no
    • toolbar: yes|no
    • width: number of pixels

Opening a New Window by Button

The openStars() function is simply
function openStars() { open("/"); }

Opening a New Window by Link

Menu Window
function makeRemote() {
	remote = window.open("","remotewin",
			"width=600,height=135");
	remote.location.href = "/old?u=http%3A%2F%2Fwdvl.internet.com%2FAuthoring%2FJavaScript%2FWindows%2FYOUR_MENU.html&y=1999";
	if (remote.opener == null)
			remote.opener = window;
	remote.opener.name = "opener";
	}
in the HEAD, and in the link:-
<a href="javascript:makeRemote()">Menu Window</a>
See also The Universal Remote.

Dynamic Creation of Window Content

I'd be back in the UK if it wasn't for the 6-month pet quarantine.

In the HEAD this is:

function popUp() {
    myWin= open("", "displayWindow",
    		"width=200,height=100");
    // open document for further output
    myWin.document.open();
    // create document
    myWin.document.write("<html><head><title>Acronym");
    myWin.document.write("</title></head><body>");
    myWin.document.write("UK:	United Kingdom");
    myWin.document.write("</body></html>");
    // close the document - (not the window!)
    myWin.document.close();
    }
And in the BODY:
<a  href	= "javascript:popUp()"
    onMouseOver	="window.status='United Kingdom';  
    			return true"
    onMouseOut	="window.status='';
    			return true"
    >
    UK</a>

For more on this, see VOODOO'S INTRODUCTION TO JAVASCRIPT: Part 4: Windows and on-the-fly documents.


Up to => Home / Authoring / JavaScript


internet.com
e-commerce
WebDeveloper Network


All Net Rearch -- in one place

Copyright 1999 internet.com Corporation. Legal Notices. Privacy Policy.

www.internet.com