Knud Gert Ellentoft <knudgert@mail.tele.dk> writes:
[color=blue]
> In <head>:
> <script LANGUAGE="JavaScript">[/color]
<script type="text/javascript">
The language attribute is deprecated, and the type attribute is mandatory,
in HTML 4.
[color=blue]
> <!-- Begin[/color]
HTML comments are not necessary in Javascript.
[color=blue]
> function NewWindow(mypage, myname, w, h, scroll) {
> var winl = (screen.width - w) / 2;
> var wint = (screen.height - h) / 2;[/color]
[color=blue]
> winprops =
> 'height='+h+',width='+w+',top='+wint+',left='+winl +',scrollbars='+scroll+',resizable=no'[/color]
It is worth mentioning that you try to center the new window wrt. the
screen. It will, ofcourse, fail in, e.g., Opera's MDI mode or in browsers
that open new windows in new tabs (e.g., Mozilla in some setups and MyIE2).
It will also look horrible on two-monitor setups, where it will probably
be placed right on the split.
<URL:http://david.us-lot.org/www/dumb/fullscreen.jpeg>
I would use screen.availWidth and screen.availHeight. It won't make
much difference in practice, but I am suggesting to Opera that they
change the availWidth/Height to the size of the MDI window ... because
it would make sense.
Make winprops a local variable too.
[color=blue]
> win = window.open(mypage, myname, winprops)[/color]
If you don't use the "win" variable outside the function, make it a
local variable.
[color=blue]
> if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }[/color]
Better:
if (win.focus) {win.focus();}
[color=blue]
> }
> // End -->[/color]
Not necessary either.
[color=blue]
> </script>[/color]
I also recommend against depending on new windows.
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'