Mozilla v IE window.open

D

DaveG

Hi All

I am having a small problem with window.open() obviously something I am
or am not doing.

This is being fired from a subwindow. Everytime I use just the
location.href = "URL" I got a new window the same size as the subwindow
it was launched from.

The code below works in Mozilla by IE still opens a window the same
size as the subwindow

x = screen.width;
y = screen.height;

extWindow = window.open("http://www.stevengould.org/software/cleanup/",
"ext", "toolbar=no, resizable=yes");
extWindow.resizeTo(x, y);
extWindow.moveTo(0, 0);

All ideas will be helpfull

Thanks in advance
 
G

Gérard Talbot

DaveG wrote :
Hi All

I am having a small problem with window.open() obviously something I am
or am not doing.

This is being fired from a subwindow. Everytime I use just the
location.href = "URL" I got a new window the same size as the subwindow
it was launched from.

The code below works in Mozilla by IE still opens a window the same
size as the subwindow

You have not provided an url nor a lot of code regarding your problem.
x = screen.width;
y = screen.height;

Your calculation here is irrelevant as most Windows users have the
Windows taskbar present and sometimes other semi-permanent applications
(eg Office Quicklaunch bar). The work area for applications is what
matters here, not the entire screen area.
extWindow = window.open("http://www.stevengould.org/software/cleanup/",
"ext", "toolbar=no, resizable=yes");

The way you coded this, your code will request to remove the navigation
toolbar and everything else removed: because the "If you define the
strWindowFeatures parameter, then the features that are not listed,
requested in the string will be disabled or removed"
http://developer.mozilla.org/en/docs/DOM:window.open#Examples
As soon as there is a blank space, feature parsing/detection is stopped.
So, the window will not be resizable because there is a blank space in
the windowFeatures string list.
"string parameter must not contain any blank space. Each requested
window feature must be separated by a comma inside the character string".
http://developer.mozilla.org/en/docs/DOM:window.open#Return_value_and_parameters

"if no size features are defined, then the new window dimensions will be
the same as the dimensions of the most recently rendered window."
http://developer.mozilla.org/en/docs/DOM:window.open#Examples

which is exactly the case here. This is by design too from browser
manufacturers.
The os must have the time to save those position and size data (re:
userdata persistence).
extWindow.resizeTo(x, y);
extWindow.moveTo(0, 0);

Resizing and moving existing windows is usually turn off by users. If
you get the size+position results you were expecting in Mozilla, it is
only because your advanced setting allow resizing and moving of existing
windows. You can expect MSIE 7 final release to follow Mozilla, Opera,
Safari on this.

Gérard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,228
Latest member
MikeMichal

Latest Threads

Top