You are here: irt.org | FAQ | JavaScript | Window | Q369 [ previous next ]
In the main window:
<SCRIPT LANGUAGE="JavaScript"><!-- function passData(data) { windowHandle = window.open('apage.html' + '?' + data,'windowName','resizable=no,width=200,height=200'); } //--></SCRIPT> <FORM onSubmit="return false"> <INPUT TYPE="TEXT" NAME="data"> <INPUT TYPE="BUTTON" VALUE="Pass Data" onClick="passData(this.form.data.value)"> </FORM>
then in the apage.htm:
<SCRIPT LANGUAGE="JavaScript"><!-- if (location.search.length > 0) document.write('Hi ' + location.search.substring(1)); //--></SCRIPT>