FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

How do you create a window without any toolbars?

 


dwcnps
How do you create a window without any toolbars?

I am asking this question so I can put my game in an HTML document without toolbars.

Thankyou...
erlendhg
You can use this script:

Quote:

<script language="JavaScript">
window.open('Url here', 'Title here', '')
</script>


This has all the options:

Quote:
<script language="JavaScript">
window.open('Url Here', 'Title Here', 'toolbar,menubar,scrollbars,resizable,directories,status,location,copyhistory,fullscreen,width=width,height=height,')
</script>


So if you want a resizable window with the height 400 and width 300 with only a statusbar, that shows index4.html and has the tile "My Window", the code will be the following:

Quote:
<script language="JavaScript">
window.open('index4.html', 'My Window', 'resizable,status,width=400,height=300,')
</script>


Opps. I just discovered that title is not the titlebar text, but the target to the window, and therefore you can't have spaces in the name. So the the example over is invalid, but this one is not:

Quote:
<script language="JavaScript">
window.open('index4.html', 'MyWindow', 'resizable,status,width=400,height=300,')
</script>
dwcnps
Thanks erlendhg,
<EDIT="delete comment">
By the way, which tag do you put it under?


Last edited by dwcnps on Thu Jul 06, 2006 9:16 am; edited 1 time in total
erlendhg
I think you can put it under both <body> and <head>, but I assume the most natural would be the <head> tag Very Happy

--EDIT--

You can also use this script on a link:

Code:
<a href="#" onClick="window.open('Url here', 'MyWindow', 'resizable,status,width=400,height=300')">Link</a>


Here you have the whole script in the <a> tag.

Code:
<script>
function newwin(url) {
window.open(url, 'MyWindow', 'resizable,status,width=400,height=300');
}
</script>
<a href="#" onClick="newwin('Url here')">Link</a>


Here we have made a function where you send in the variable 'url' as the url in the script and the <a> tag calls up the function with 'Url here' as the url.
Place the <script> in <head>, and <a> in <body>.

Code:
<script>
function newwin() {
window.open('Url here', 'MyWindow', 'resizable,status,width=400,height=300');
}
</script>
<a href="#" onClick="newwin()">Link</a>


And here, all the parametres in the script are in the <script> tag, and <a> calls up the function with no variables passing in.
dwcnps
Thanks again... Razz
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.