Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

maximizing window with xml file

Question posted by: Marina Ferguson (Guest) on July 20th, 2005 12:06 PM
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,o bjHelpWin.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.




Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
DU's Avatar
DU
Guest
n/a Posts
July 20th, 2005
12:06 PM
#2

Re: maximizing window with xml file
Marina Ferguson wrote:
[color=blue]
> 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");[/color]

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.
[color=blue]
> objHelpWin.moveTo(0,0);
>
> objHelpWin.resizeTo(objHelpWin.screen.availWidth,o bjHelpWin.screen.availHeig
> ht);[/color]

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.
[color=blue]
> }
>
> 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.
>
>[/color]


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

DU


 
Not the answer you were looking for? Post your question . . .
183,632 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors