Re: Rationale question





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/
.



Relevant Pages

  • Re: Really basic float right problem cross browser
    ... inline content in before it looks different in every browser. ... Suspendisse consectetuer velit nec neque. ... Ut quis eros. ...
    (alt.html)
  • Re: Notepad and UTF-8
    ... the html element to tell the browser the language so it can use that as ... Each browser I try seems to have its own variation of what a page ... For example, in Safari, in the title element of a commercial site ... curl -I http://mecu.com.au ...
    (comp.infosystems.www.authoring.html)
  • Re: Question about positionning.
    ... I observed something strange in Firefox which let me study precisely the ... section 10.3.7 of the specifications of CSS2 and I have a question about it. ... whether the box was originally inline or block, ... But that's expecting the browser to take the hypothesis a bit far I ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Request.Form doesnt work in email
    ... See inline comments: ... >> You mean when the user presses SUBMIT, no form values are being passed? ... Jeff ... >I get the value of the id written to the browser. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Streaming files to Firefox
    ... browser. ... Both browsers correctly prompt me to open or download the file. ... need to enable the Acrobat Reader plugin under Firefox to make inline ...
    (comp.lang.java.programmer)

Loading