Re: Rationale question
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Mon, 10 Oct 2005 19:30:03 +0200
Robert Latest wrote:
One thing that struck me as odd was that there is no way to portably
find out the size (in pixels) of the current browser window
That is a question of the browser object model then, not of a particular scripting language.
(or of any HTML element for that matter, unless it was inline-CSSed).
That is a question of the document object model then, have you ever heard about the offsetWidth/offsetHeight properties that IE introduced in IE 4 and that by now are part of the object model of element objects in browsers like Mozilla, Netscape 6 and later, Opera 7 and later and others?
<http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/offsetwidth.asp>
And there is more support in the DOM than for inline CSS (element.style), the W3C DOM Level 2 defines stuff to get the computed style and Mozilla and Opera support that e.g.
document.defaultView.getComputedStyle(someElementObject, '').width
Somehow I can't believe that the creators of JS have simply forgotten to give the "Window" object "width" and "height" properties.
I think you need to first understand the difference between the JavaScript language some creators defined and implemented and the object model an application like a browser exposes to script.
<http://jibbering.com/faq/#FAQ2_6>
<http://jibbering.com/faq/#FAQ2_8>
As for such properties lots of browsers (Netscape, Mozilla, Opera) have window.outerWidth window.outerHeight for instance.
--
Martin Honnen http://JavaScript.FAQTs.com/ .
- References:
- Rationale question
- From: Robert Latest
- Rationale question
- Prev by Date: Re: another document.[formName] has no properties error
- Next by Date: Re: Rationale question
- Previous by thread: Re: Rationale question
- Next by thread: Re: Rationale question
- Index(es):
Relevant Pages
|
Loading