R
Robert Latest
Hello,
I'm new in javascript programming (but am quite literate in HTML, CSS,
and C). It's amazing what one can do with JS and fairly modern browsers.
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 (or of any
HTML element for that matter, unless it was inline-CSSed).
I'm wondering what the reason for this might be.
Of course a properly authored web site should render well on any broser
window size, so one might argue that JS doesn't provide access to things
that needn't be accessed in well-designed web pages. On the other hand,
JS provides a plethora of annoying design "no-nos", such as creating of
pop-ups and even resizing and moving the browser window.
Somehow I can't believe that the creators of JS have simply forgotten to
give the "Window" object "width" and "height" properties. I believe they
omitted it on purpose, and I'd like to know the purpose just out of
curiosity (and while we're at it: What the hell am I supposed to do with
the pixel size of the screen the browser is running on?)
Thanks,
robert
I'm new in javascript programming (but am quite literate in HTML, CSS,
and C). It's amazing what one can do with JS and fairly modern browsers.
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 (or of any
HTML element for that matter, unless it was inline-CSSed).
I'm wondering what the reason for this might be.
Of course a properly authored web site should render well on any broser
window size, so one might argue that JS doesn't provide access to things
that needn't be accessed in well-designed web pages. On the other hand,
JS provides a plethora of annoying design "no-nos", such as creating of
pop-ups and even resizing and moving the browser window.
Somehow I can't believe that the creators of JS have simply forgotten to
give the "Window" object "width" and "height" properties. I believe they
omitted it on purpose, and I'd like to know the purpose just out of
curiosity (and while we're at it: What the hell am I supposed to do with
the pixel size of the screen the browser is running on?)
Thanks,
robert