Back to Scripts page
Click in the text area below, select all and copy to grab the script
Script 5.10 listing:
<HTML> <HEAD> <TITLE>Parent Window</TITLE> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> <!-- Hide script from old browsers newWindow = window.open('cpanel.html', 'newWin', 'width=225,height=200') // End hiding script from old browsers --> </SCRIPT> </HEAD> <BODY BGCOLOR=WHITE> <CENTER> <H1>JavaScript for the World Wide Web, 3rd Edition</H1> <H2>by Tom Negrino and Dori Smith</H2> <IMG SRC="js3-sm.gif" WIDTH=109 HEIGHT=140> </CENTER> </BODY> </HTML>
Script 5.11 listing:
<HTML> <HEAD> <TITLE>Child Window</TITLE> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> <!-- Hide script from old browsers function updateParent(newURL) { opener.document.location = newURL } // End hiding script from old browsers --> </SCRIPT> </HEAD> <BODY BGCOLOR=WHITE> <CENTER> <H1>Control Panel</H1> <H3><A HREF="javascript:updateParent('toc.html')">Table of Contents</A><BR> <A HREF="javascript:updateParent('chapter.html')">Sample Chapter</A><BR> <A HREF="javascript:updateParent('about.html')">About the Authors</A><BR> <A HREF="javascript:updateParent('buy.html')">Buy the book!</A></H3> </CENTER> </BODY> </HTML>