JavaScript Windows
The open() call takes these arguments:
- URL of a page to be displayed in it.
- The name to be given to the window.
- 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 = "YOUR_MENU.html";
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.
|