Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > screenX and screenY not working properly

Reply
Thread Tools

screenX and screenY not working properly

 
 
Matt Stanley
Guest
Posts: n/a
 
      01-06-2004
I'm trying to use a popup window script that opens the new window to a
specific X,Y coordinate... I'm pretty sure that the window.screenX and
window.screenY properties are the answer, but I'm having very little success
in making this all work in both IE and NS.

Here's my code as it stands today:

function windowOpen3(URL, windowW, windowH) {
strWindow =
'toolbar=no,status=no,scrollbars=no,location=no,me nubar=no,directories=no,re
sizable=0,size=yes,width=' + windowW + ',height=' + windowH +
'screenX=100,screenY=100'
window.open(URL,'hwWindow',strWindow)
}

IE is ignoring the X,Y coordinates completely and opening the new window so
far over to the right that half of it is off-screen and NS is picking up the
screenY setting but ignoring screenX.

Am I missing something here? Please help, and TIA.

Stanman


 
Reply With Quote
 
 
 
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      01-06-2004
"Matt Stanley" <(E-Mail Removed)> writes:

> 'toolbar=no,status=no,scrollbars=no,location=no,me nubar=no,directories=no,re
> sizable=0,size=yes,width=' + windowW + ',height=' + windowH +
> 'screenX=100,screenY=100'

....
> IE is ignoring the X,Y coordinates completely


Yep. They never claimed to understand it.
<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp>

> NS is picking up the screenY setting but ignoring screenX.


Missing "," before "screenX".

> Am I missing something here? Please help, and TIA.


I recommend using "left" and "top" instead of "screenX" and "screenY".
These properties seem to work in all browsers since Netscape 4 (do tell
me if you find exceptions
<URL:http://www.infimum.dk/HTML/JSwindows.html#ref_3_2>

While it is not documented by Netscape, "left" and "top" it seems to
be supported from (at least) Netscape 4.08.
(<URL:http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1202731>)
I doesn't work in Netscape 3, but that's not really a problem any more.

Actually, I recommend aginst trying to position windows at all. In MDI
browsers or dual-monitor displays, it can be quite disruptive, and in other
browsers, it's usually not needed.
<URL:http://www.infimum.dk/HTML/JSwindows.html#ref_3_3>

/L
--
Lasse Reichstein Nielsen - http://www.velocityreviews.com/forums/(E-Mail Removed)
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      01-06-2004
Matt Stanley said:
>
>I'm trying to use a popup window script that opens the new window to a
>specific X,Y coordinate... I'm pretty sure that the window.screenX and
>window.screenY properties are the answer, but I'm having very little success
>in making this all work in both IE and NS.
>
>Here's my code as it stands today:
>
>function windowOpen3(URL, windowW, windowH) {
> strWindow =
>'toolbar=no,status=no,scrollbars=no,location=no,m enubar=no,directories=no,re
>sizable=0,size=yes,width=' + windowW + ',height=' + windowH +
>'screenX=100,screenY=100'
> window.open(URL,'hwWindow',strWindow)
>}
>
>IE is ignoring the X,Y coordinates completely and opening the new window so
>far over to the right that half of it is off-screen and NS is picking up the
>screenY setting but ignoring screenX.
>
>Am I missing something here? Please help, and TIA.


You're missing a comma before "screenX".
You've invented an attribute named "size".
IE ignores screenX and screenY, expecting left and top, instead.
You don't need to list attributes that are set to "no", since that
is the default if you specify values for any other attributes:

function windowOpen3(URL, windowW, windowH) {
strWindow = 'width=' + windowW + ',height=' + windowH
+ ',screenX=100,screenY=100,top=100,left=100';
window.open(URL,'hwWindow',strWindow);
}

 
Reply With Quote
 
Matt Stanley
Guest
Posts: n/a
 
      01-06-2004
Thanks so much for your help! That TOTALLY worked. It's always nice when
developers help each other; you guys both just made my day!

"Lasse Reichstein Nielsen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Matt Stanley" <(E-Mail Removed)> writes:
>
> >

'toolbar=no,status=no,scrollbars=no,location=no,me nubar=no,directories=no,re
> > sizable=0,size=yes,width=' + windowW + ',height=' + windowH +
> > 'screenX=100,screenY=100'

> ...
> > IE is ignoring the X,Y coordinates completely

>
> Yep. They never claimed to understand it.
>

<URL:http://msdn.microsoft.com/workshop/a.../methods/open_
0.asp>
>
> > NS is picking up the screenY setting but ignoring screenX.

>
> Missing "," before "screenX".
>
> > Am I missing something here? Please help, and TIA.

>
> I recommend using "left" and "top" instead of "screenX" and "screenY".
> These properties seem to work in all browsers since Netscape 4 (do tell
> me if you find exceptions
> <URL:http://www.infimum.dk/HTML/JSwindows.html#ref_3_2>
>
> While it is not documented by Netscape, "left" and "top" it seems to
> be supported from (at least) Netscape 4.08.
>

(<URL:http://devedge.netscape.com/library/...ipt/1.3/refere
nce/window.html#1202731>)
> I doesn't work in Netscape 3, but that's not really a problem any more.
>
> Actually, I recommend aginst trying to position windows at all. In MDI
> browsers or dual-monitor displays, it can be quite disruptive, and in

other
> browsers, it's usually not needed.
> <URL:http://www.infimum.dk/HTML/JSwindows.html#ref_3_3>
>
> /L
> --
> Lasse Reichstein Nielsen - (E-Mail Removed)
> DHTML Death Colors:

<URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
> 'Faith without judgement merely degrades the spirit divine.'



 
Reply With Quote
 
Matt Stanley
Guest
Posts: n/a
 
      01-06-2004
Thanks so much for your help! That TOTALLY worked. It's always nice when
developers help each other; you guys both just made my day!

"Lee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Matt Stanley said:
> >
> >I'm trying to use a popup window script that opens the new window to a
> >specific X,Y coordinate... I'm pretty sure that the window.screenX and
> >window.screenY properties are the answer, but I'm having very little

success
> >in making this all work in both IE and NS.
> >
> >Here's my code as it stands today:
> >
> >function windowOpen3(URL, windowW, windowH) {
> > strWindow =

>
>'toolbar=no,status=no,scrollbars=no,location=no,m enubar=no,directories=no,r

e
> >sizable=0,size=yes,width=' + windowW + ',height=' + windowH +
> >'screenX=100,screenY=100'
> > window.open(URL,'hwWindow',strWindow)
> >}
> >
> >IE is ignoring the X,Y coordinates completely and opening the new window

so
> >far over to the right that half of it is off-screen and NS is picking up

the
> >screenY setting but ignoring screenX.
> >
> >Am I missing something here? Please help, and TIA.

>
> You're missing a comma before "screenX".
> You've invented an attribute named "size".
> IE ignores screenX and screenY, expecting left and top, instead.
> You don't need to list attributes that are set to "no", since that
> is the default if you specify values for any other attributes:
>
> function windowOpen3(URL, windowW, windowH) {
> strWindow = 'width=' + windowW + ',height=' + windowH
> + ',screenX=100,screenY=100,top=100,left=100';
> window.open(URL,'hwWindow',strWindow);
> }
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE 6.0 ignores screenX (Y) parameters in window.open(...). Firefox not. BoBi Javascript 3 10-20-2006 07:07 PM
State not working properly -- sessions and ASP.NET 2.0 Profiles ASP .Net 1 08-24-2006 12:14 PM
Need help! E drive is called D drive and programs are not working properly Rob Computer Support 1 02-11-2005 06:10 PM
ICS not working properly AuthorizedUser Wireless Networking 2 08-23-2004 04:46 AM
More American Graffiti: Properly Framed, Properly Scored? Scot Gardner DVD Video 0 09-02-2003 02:28 AM



Advertisments