Connecting Tech Pros Worldwide Help | Site Map

maximizing window with xml file

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 12:06 PM
Marina Ferguson
Guest
 
Posts: n/a
Default maximizing window with xml file

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.





  #2  
Old July 20th, 2005, 12:06 PM
DU
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.