Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing the window with Javascript 1

Status
Not open for further replies.

PavelGur

Programmer
Sep 21, 2001
75
I'm using the function I found on Microsoft site to resize the browser window. The function looks like this:
<script language="JavaScript">
window.onload = maxWindow;

function maxWindow()
{
window.moveTo(0,0);


if (document.all)
{
<!-- I changed the following to constant sizes -->
top.window.resizeTo(630,700);
// top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
It works fine with one htm file. However with another that works well w/o this function I'm getting the security warning: "To help protect your security, Internet Explorer had restricted from showing active content that could access your computer. Click here for options...".
Does anybody know what is the problem?
Thanks, Pavel.
 
Yes, you are running the HTML page locally and not through a web server. If you have Windows XP Pro with IIS installed, or any other web server, run the page through the server and you shouldn't have that message show up.

Lee
 
Thanks, that's what I thought. However why it happened on one page and not on another? Also I noticed that the first page I opened after starting computer dictates the size of the screen. I hope this also will be corrected with the server. And one more thing. When test with Front Page hyperlink does work. However if I try with IE it does not work with local drive. Can it be corrected somehow or I need to wait until I put whole thing on the server?
Thanks again, Pavel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top