wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Setting the browser window size on load ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Setting the browser window size on load ?" Watch "Setting the browser window size on load ?" New topic
Author

Setting the browser window size on load ?

Duncan Murray
Greenhorn

Joined: Dec 06, 2002
Posts: 2
Does anybody know how I can set the size the window should be when it loads ?
I know it's possible from a <a href> click, but I want it to be a script on every page in my website when the page loads.
(IE Browsers only)
Thank you. Duncan
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Place in Head Tags
Remove the _ from on_load
<script>
function ReSizeIt(){
//window.moveTo(0,0);
window.resizeTo(300,200)
}
window.on_load=ReSizeIt;
window.onresize=ReSizeIt;
</script>
[ December 09, 2002: Message edited by: Eric Pascarello ]
Duncan Murray
Greenhorn

Joined: Dec 06, 2002
Posts: 2
Thanks Eric.
I have put the script into the header, but it dosen't make any differnece !? Do I need to call the fumction in the <BODY> ?
Duncan.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
did you remove the bar from on_load??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting the browser window size on load ?
 
Similar Threads
Passing data between ASP and JSP via session obj
Setting window size on load
javascript and iFrame
Hiding URL in pop-up window
Session in Pop up window ?