File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes open new browser already maximized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "open new browser already maximized" Watch "open new browser already maximized" New topic

open new browser already maximized

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

When I open a new browser like this
<a href="something.html" target="outside">
is there a way to force it to open maximized?

Visit my download page
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
In JavaScript you can use the open method of the window object to open a new window very big, but you cannot programmatically maximize a window this way.
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
If the page you are opening up is a page you are creating, you can have an onLoad event that maximizes the window. So you are not doing it in the page that opened the window, but in the page that gets opened.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
What code would you put in the event handler to actually do the maximizing?
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
Well it is actually a work around to do it. There is no mazimize() function. But you can resize it to the maximum dimensions of your screen. The code would look like this:
***This was taken from

[This message has been edited by bill bozeman (edited February 22, 2001).]

Joined: Dec 01, 2001
Posts: 1

I tried this script, but it doesnt fully maximize the window, it only resizes it to the full available size.

function maximizeWin() {
if (window.screen) {
var aw = screen.availWidth;
var ah = screen.availHeight;
window.moveTo(0, 0);
window.resizeTo(aw, ah);
// -->
<FORM><INPUT TYPE="button" VALUE="Maximize" onClick="maximizeWin()"></FORM>

Does anyone know a script, or a place to get one, that actually maximizes?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
I have a script on my web page that will allow you to do whatever you want with the pop up
go here
any other questions just email me, or post here
I agree. Here's the link:
subject: open new browser already maximized
jQuery in Action, 3rd edition