I want to open a new window without all the crap directories, status bar, scrollbars, etc. (it's linked to a picture you click on). I'd like to not use java if i can avoid it, so i thought id ask you guys - i gave it a shot, but obviously screwed it up, cos it won't work.
So i'd really, truly apprectiate the whole code written out if it's not a massive hassle... i just need the obvious pointed out )
You can't open a window with just HTML. You have to do it with JavaScript. If you don't want all the window properties, make you window script like this:
<script language="JavaScript" type="text/JavaScript">
<!-- Begin
function newWindow() {
newWin = window.open("","Your windows title","width=whatever,height=whatever,scrollbars=no,menubar=no,status=no,toolbar=no,resizable=no");
newWin.document.write("Your new Windows contents");
newWin.focus();
}
// End -->
</script>
<a href="javascript:newWindow();">Open New Window</a>
That will give you a window without all the menu's added to it and stuff.
That space in between the java and script (java script) is an error. I don't know what's happening. I went to edit that thinking it was a mistake I made but the words were together and it still appeared that way. When you write your code take the space out.
Originally posted by Zach Elfers
That space in between the java and script (java script) is an error.
No the error is to use that Javascript: AT ALL. It's neighter needed nor correct.
This works as it should, girl. It's possible that other broken stuff on your page messes something up.
So start with this code example and add the rest of your page to it.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>JS popup</title>
<script type="text/javascript">
function newWindow() {
window.open('test.html','winname','toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directo ries=no,resizable=no,width=640,height=480');
}
</script>
</head>
<body>
<a href="test.html" target="_blank" onclick="newWindow();return false;">Open New Window</a>
Let me just add that if you specify any part of the window geometry, say height and width, then the other parts default to 'no'. You never need to write toolbar=no. See http://developer.netscape.com/docs/m...ow.htm#1202731 for window geometry deails.
Bookmarks