Et lille eksempel på hvordan man kan overføre parameter mellem html-sider:
Hovedside:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no';
win = window.open(mypage, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus();
}
}
-->
</SCRIPT>
</HEAD>
<BODY>
<form name="data">
<input type="button" value="PopUP" onclick="javascript:NewWindow('popup.html','','240','185','no');">
<input type="TEXT" name="XXX" value="" size="10">
</form>
</BODY>
</HTML>
Popup:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
function CloseWindow() {
opener.document.data.XXX.value = document.forms.QQQ.
.value;
self.close();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME='QQQ'>
<INPUT TYPE="TEXT" NAME="
">
<BR>
<A HREF="javascript:CloseWindow();">Luk vindue</A>
</FORM>
</BODY>
</HTML>
Mvh
Kim