Back to Scripts page
Click in the text area below, select all and copy to grab the script
Script 5.6 listing:
<HTML> <HEAD> <TITLE>Big Window</TITLE> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> <!-- Hide script from old browsers newWindow = window.open('child.html', 'newWin', 'toolbar=yes,location=yes,scrollbars=yes,width=300,height=100') // End hiding script from old browsers --> </SCRIPT> </HEAD> <BODY BGCOLOR=WHITE> <CENTER> <H1>Welcome to this page!</H1> <FORM NAME="outputForm"> <INPUT TYPE=TEXT SIZE=20 NAME="msgLine" VALUE=""> </FORM> </CENTER> </BODY> </HTML>
Script 5.7 listing:
<HTML> <HEAD> <TITLE>Little Window</TITLE> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> <!-- Hide script from old browsers function updateParent(textField) { opener.document.outputForm.msgLine.value = "Hello " + textField.value + "!" } // End hiding script from old browsers --> </SCRIPT> </HEAD> <BODY BGCOLOR=WHITE> <H1>What's your name?</H1> <FORM> <INPUT TYPE=TEXT onBlur="updateParent(this)" SIZE=20> </FORM> </BODY> </HTML>