PDA

Click to See Complete Forum and Search --> : pop up window


3MeMoS
May 27th, 2002, 01:38 AM
i want that when i click on enter a window will pop out with on it's title no status bar nor menus no icons, nothing only the title

punkpie_uk
May 27th, 2002, 03:43 AM
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function popup(){
window.open('test.html', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=200');
}
//-->
</script>

</head>
<body>
<input type="button" value="Enter" onclick="popup()">
</body>
</html>

Rick Bull
May 27th, 2002, 07:01 AM
I use this function when using JavaScript to open links:


<script type="text/javascript"><!--
//If possible opens a window and returns false, else returns true
function openWindow(windowURI, windowWidth, windowHeight) {
/*YOU CAN EDIT THESE VALUES*/
var windowConfig = 'toolbar=no, ';
windowConfig += 'menubar=no, ';
windowConfig += 'scrollbars=no, ';
windowConfig += 'resizable=yes, ';
windowConfig += 'location=no, ';
windowConfig += 'directories=no, ';
windowConfig += 'status=no';
/*END EDITING*/

//Set the window width/height if present
if (windowWidth != null) windowConfig += ', width=' + windowWidth;
if (windowHeight != null) windowConfig += ', width=' + windowHeight;
//Default return value is true, in case browser doesn't support window.open
var returnValue = true;
//Open the window with the above config if avaliable
if (window.open) {
window.open(windowURI, '_blank', config = windowConfig);
//Return false to stop non-JS link working
returnValue = false;
}
//Return false so that the link will be surpressed
return returnValue;
}
//--></script>


and then for the actual link, something like this:


<a href="THEPAGE.htm" onclick="return openWindow(this.href);">CLICK ME!</a>


That way if the user don't have JS (or the Window.open function) it will just open in the same window.