maximizing window with xml file

M

Marina Ferguson

Hi,

I have a function that I use to open a window and maximize it:

function funOpenWin(strPath) //strPath contains path to the file to load
{
var objHelpWin;
objHelpWin = window.open( strPath, "_blank", "menubar=no,
scrollbars=yes, status=yes");
objHelpWin.moveTo(0,0);

objHelpWin.resizeTo(objHelpWin.screen.availWidth,objHelpWin.screen.availHeig
ht);
}

If I pass it a file with an .html extension, it works just fine. But if I
pass it a file with an .xml extension, it gives me an error on the last
line. The window still opens and displays just fine, but it's not
maximized.

Any help would be appreciated.
 
D

DU

Marina said:
Hi,

I have a function that I use to open a window and maximize it:

function funOpenWin(strPath) //strPath contains path to the file to load
{
var objHelpWin;
objHelpWin = window.open( strPath, "_blank", "menubar=no,
scrollbars=yes, status=yes");

Your window.open call as written will have no scrollbars (if they are
needed, that is if content overflows window dimensions) and will not
have a status bar simply because there are blank spaces in your 3rd
parameter. That is unless the user has customized his browser to impose
to render scrollbars (if needed) and to impose presence of a statusbar
via hidden prefs.
objHelpWin.moveTo(0,0);

objHelpWin.resizeTo(objHelpWin.screen.availWidth,objHelpWin.screen.availHeig
ht);

I would not use moveTo and resizeTo methods for several reasons. One of
them is that many users can now neutralize calls to these methods (via
UI prefs, hidden prefs or browser add-ons). Another one is that there
are bugs related to the memory management (asynchronuous) of window
object reference (your objHelpWin) in several browsers. Another one is
that setting left, top, width and height in the window.open call is more
reliable and less cpu and RAM demanding. Finally the most important
reason is that trying to maximize a requested popup is going to cause
usability difficulties (which I will not explicit here) for many users
or it will annoy users with large screen and/or multiple screens.
}

If I pass it a file with an .html extension, it works just fine. But if I
pass it a file with an .xml extension, it gives me an error on the last
line. The window still opens and displays just fine, but it's not
maximized.

Any help would be appreciated.


For many reasons, what you are trying to do is not recommendable.

DU
 

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,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top