You are on page 1of 2

Opening a Window at Startup

<HTML>
<HEAD>
<Script Language="JavaScript">
<!--
function OpenWindow(FileToOpen,winName,x,y){
if ((navigator.appName == "Netscape")){
if (navigator.appVersion.charAt(0) == "3"){
x = Number(x) + 10;
y = Number(y) + 38;
}
else{
x = Number(x) + 0;
y = Number(y) + 20 ;
}
}
//else
var str = "WIDTH=" + x + ",HEIGHT=" + y +"'";
window.open(theURL,winName,str);
}
//-->
</script>
<TITLE>HTML Tutorial - FunctionX</TITLE>

</HEAD>
<BODY>
Main Opening File
<SCRIPT LANGUAGE="JavaScript">
<!--
OpenWindow('exo1.htm','PopupFile','314','338')
//-->
</SCRIPT>
</BODY>
</HTML>

Home Copyright © 2003 FunctionX, Inc. E-Mail

Closing a Window
To close a window using a button
<form>
<input type="button" value="Close Window" onClick="self.close()">
</form>
To close a window using a (simple) link
<font face="arial, helvetica" size="-2"><a href="javascript:self.close()" target="_self">Close window
now</a></font>
To close a window
<html>
<head>
<title>FunctionX Tutorials</title>
</head>
<body>
To close a window using a text link<br>
<a href="javascript:window.close();">Close</a>

</body>
</html>

Home Copyright © 2000 FunctionX E-Mail

You might also like