Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2005, 03:44 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is there a standard yet for window.open ...

which defines the properties telling where the new window will be located on the screen?

All ref's I've seen have Netscape using one pair of properties, "IE4+" another, but even those (top and left) aren't working for me on IE6+.

If there's no standard, what is the current terminology in IE?

And why does
alert("pixels from top = " + window.top)
produce
"pixels from top = [object]" in IE6

while the same with "left" instead of "top" produces "undefined"?
 
Old August 19th, 2005, 04:05 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:
And why does
alert("pixels from top = " + window.top)
produce
"pixels from top = [object]" in IE6
while the same with "left" instead of "top" produces "undefined"?
Because window.top means the top level window, if this is a frameset then the first declared frame otherwise the only window and is therefore a window object whereas window.left is something you just made up for an IE window so is undefined :)
Did you mean window.screenTop and window.screenLeft?

--

Joe (Microsoft MVP - XML)
 
Old August 19th, 2005, 10:49 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry - I was being dumb and missed the second meaning of "top". I arrived at my syntax based on reading that one of the properties (attributes?) of the winFeatures string [in "window.open(*,*,winFeatures)"] was "top", as in "...,top = 100,...") (and another was "left" - both IE only, Netscape using something completely different) and so I assumed that window.top would reference it (which is really dumb because the project I'm working on is a 4-frame window, and the javascript functions controlling all 4 frames are in frames[3], so I'm using "top" as a base reference every day.)

So, ARE .screenTop and .screenLeft W3 standard now (and therefore implemented in the current versions of most browsers)?

Thanks for the reply and whatever further info you can provide - I'm still very new at scripting.





Similar Threads
Thread Thread Starter Forum Replies Last Post
window.open() ckrajeshvarma ASP.NET 2.0 Professional 5 August 16th, 2006 09:13 AM
Open New Window b_camp Classic ASP Basics 2 May 12th, 2005 01:19 AM
Open in new window sridevi Excel VBA 1 November 4th, 2004 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.