window properties

liunx

Guest
hey there. just had a quickie.<br />
<br />
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. <br />
<br />
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 :o)<!--content-->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:<br />
<br />
<script language="JavaScript" type="text/JavaScript"><br />
<!-- Begin<br />
<br />
function newWindow() {<br />
newWin = window.open("","Your windows title","width=whatever,height=whatever,scrollbars=no,menubar=no,status=no,toolbar=no,resizable=no");<br />
newWin.document.write("Your new Windows contents");<br />
newWin.focus();<br />
}<br />
<br />
// End --><br />
</script><br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:newWindow();">Open New Window</a><br />
<br />
That will give you a window without all the menu's added to it and stuff.:)<!--content-->Originally posted by Zach Elfers <br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:newWindow();">Open New Window</a><br />
<br />
<br />
That code breaks the link if JS is not available, not to mention that it is incorrect JavaScript.<br />
<br />
Try <br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"imagelocation" target="_blank" onclick="newWindow(); return false;">Open New Window</a><br />
<br />
That will make it work in all browsers at least partially.<!--content-->hey hey ther. thanks for helping me out. i dont know what the flop i'm doing wrong, but it wont even open a new window now.<br />
<br />
would you mind having a look at my page for me??<br />
<br />
<!-- m --><a class="postlink" href="http://www.geocities.com/aribanana/leslie/theband.htm">http://www.geocities.com/aribanana/leslie/theband.htm</a><!-- m --><br />
<br />
just that pic you click on is meant to open a new window with none of the scrollbar toolbar crap - but i've stuffed it up somehow. : o(<!--content-->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.<!--content-->Originally posted by Zach Elfers <br />
That space in between the java and script (java script) is an error. <br />
<br />
No the error is to use that Javascript: AT ALL. It's neighter needed nor correct.<br />
<br />
This works as it should, girl. It's possible that other broken stuff on your page messes something up.<br />
So start with this code example and add the rest of your page to it.<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><br />
<html><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<meta http-equiv="Content-Script-Type" content="text/javascript"><br />
<meta http-equiv="Content-Style-Type" content="text/css"><br />
<title>JS popup</title><br />
<script type="text/javascript"><br />
function newWindow() {<br />
window.open('test.html','winname','toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directo ries=no,resizable=no,width=640,height=480');<br />
}<br />
</script><br />
</head><br />
<body><br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"test.html" target="_blank" onclick="newWindow();return false;">Open New Window</a><br />
<br />
</body><br />
</html><!--content-->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 <!-- m --><a class="postlink" href="http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm#1202731">http://developer.netscape.com/docs/manu ... tm#1202731</a><!-- m --> for window geometry deails.<!--content-->
 
Back
Top