>> for (var property in window.screen) {
>> document.write('<p>' + property + ': ' + window.screen[property] +
[quoted text clipped - 4 lines]
>
> Actually, when I came to try this, I couldn't get it to work.
The code is correct, if you try that with Netscape for instance it shows
you properties that you expect.
The problem with
for (var property in object)
is that it enumerates all properties of the object that are _marked as
being enumerable_ and there is no standard for screen specifying whether
its properties should be marked as being enumerable. Thus if you run the
code with IE/Win for instance and nothing shows up then it is because
the IE implementors have decided to mark the properties of screen as
being not enumerable.
There is nothing you can do about that with your code, but of course
IE's object model is well documented so look into the SDK documentation
first for the properties it defines for an object.

Signature
Martin Honnen
http://JavaScript.FAQTs.com/
Mark Rae - 07 Aug 2004 18:13 GMT
> There is nothing you can do about that with your code, but of course
> IE's object model is well documented so look into the SDK documentation
> first for the properties it defines for an object.
OK - thanks.