PDA

View Full Version : Open an html with preset size


giuseppe74
09-20-2002, 11:16 AM
Hello,
it's possible to open an html with a preset size?
The html page is an html page opened directly from the url browser and not from any window.open.
Thanks,

Giuseppe

requestcode
09-20-2002, 01:32 PM
You could resize the window once the page loads. Here is an example:
<HTML>
<HEAD>
<TITLE>Resize test</TITLE>

<SCRIPT LANGUAGE="JavaScript">
function doresize()
{
window.resizeTo(600,400)
}
window.onload=doresize()
</SCRIPT>
</HEAD>
<BODY>
<CENTER>
<BR><BR><BR><BR>
<H2>Resize</H2>
</CENTER>
</BODY>
</HTML>

giuseppe74
09-23-2002, 08:42 AM
it works but it returns an error on the status bar, the error is (translated from italian) "Not implemented" on the line where is the command "window.onload=doresize();"

glenngv
09-23-2002, 08:46 AM
remove the parentheses:

window.onload=doresize;

giuseppe74
09-23-2002, 10:19 AM
yes, it works fine....really thanks!!! :)

giuseppe74
09-23-2002, 11:20 AM
another thing...it's possible to open the same page without the toolbar?

ionsurge
09-23-2002, 11:44 AM
Yep.

;)

giuseppe74
09-23-2002, 11:47 AM
ehm...ok...is possible...but wich is the command? :confused:

abbylee
09-23-2002, 12:13 PM
Could someone compile the way to do this for all the variables? ie window size, toolbar, status bar, resizable, scrollbars....

I know how to do it for a pop up window...

function PopUp(url)
{
win=window.open(url,"blah","resizable=yes,height=380,width=540,toolbar=yes,menubar=yes,directories=yes");
}

But I also only know how to do that where I write the whole file via javascript on the fly.

How about if I have an externally linked file that I'd like displayed in a certain way?

giuseppe74
09-23-2002, 12:26 PM
no...there is a mistake...i would like to know if i can open a page without toolbar, with preset size but WITHOUT any window.open command.
This code posted before by requestcode is good for opening a page with a preset size...but when i open this page is possibile to open it without the toolbar?

<HTML>
<HEAD>
<TITLE>Resize test</TITLE>

<SCRIPT LANGUAGE="JavaScript">
function doresize()
{
window.resizeTo(600,400)
}
window.onload=doresize()
</SCRIPT>
</HEAD>
<BODY>
<CENTER>
<BR><BR><BR><BR>
<H2>Resize</H2>
</CENTER>
</BODY>
</HTML>

glenngv
09-23-2002, 12:37 PM
no, you can't remove the toolbars in the parent window.

giuseppe74
09-23-2002, 02:03 PM
ok...thank you very much!