You are here: irt.org | FAQ | JavaScript | Window | Q40 [ previous next ]
Within the original window:
<script language="JavaScript"><!--
function newWindow(file,window) {
msgWindow=open(file,window,'resizable=no,width=200,height=200');
if (msgWindow.opener == null) msgWindow.opener = self;
}
//--></script>
<form>
<input type="button" value="Open New Window" onClick="newWindow('a.html','window2')">
</form>Within the new window:
<script language="JavaScript"><!--
function load(file,target) {
if (target != '')
target.window.location.href = file;
else
window.location.href = file;
}
//--></script>
<a href="javascript:load('b.html',top.opener)">load document into opener</a>
<p>
<a href="javascript:load('b.html','')">load document</a>