Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Making windows - code


<head>

<script language="javascript">
/*
Declare the global variable to reference the window that is created
*/
referenceToWindowObject = null

function makeWindow(){

/*
If the window is not made or it was closed make the window
*/
if(referenceToWindowObject == null || referenceToWindowObject.closed){
var url = '' //The Conent of this window
var targetName = "impotent_notice"//Used for targeting
var properties = //Set up the window feature list, delimited by comma(,)
"menubar=" + false + ","//Do not show the menu bar
+ "toolbar=" + false + ","//Do not show the tool bar
+"location=" + false + "," // Do not show the location bar
+ "status=" + false + "," //Do not show the status bar
+ "resizable=" + false + ","//Disallow the window to be reissued
+ "width=" + 220 + ","//Width of the window
+ "height=" + 196 + ","// Height of the window
+ "screenX=" + 313 + ","//x position of the window for Internet Explorer
+ "left=" + 313 + "," // x position of the window for Netscape Navigator
+ "screenY=" + 197 + ","//y position of the window for Internet Explorer
+ "top=" + 197//y position of the window for Netscape Navigator
/*
Make the window with the three sets of required parameters.
When the window is made a reference of
it is inserted into referenceToWindowObject
*/
referenceToWindowObject = open(url,targetName,properties) /*
Use the window reference to write the message to
it's document wrapped in a <H1> tag
*/
referenceToWindowObject.document.write(" <H1> IMPOTENT NOTICE! </H1>")
}else{//This window is visible maybe minimized and Not closed
/*
Give the focus to the window by using it's focus method
*/
referenceToWindowObject.focus()
}
}
</script>
</head>

<body> <!--

Define the button in the body of the document
and make it's onClick event call the makeWindow function
--> <input type="button" value="Call Make Window function" onClick="makeWindow()"> </body><!-- Close the body element -->


Close