Default value of JS window object

Koos Vriezen koos.vriezen at xs4all.nl
Fri Jul 5 16:40:05 BST 2002


On Fri, 5 Jul 2002, Harri Porten wrote:

> On Fri, 5 Jul 2002, Koos Vriezen wrote:
>
> > There is still a problem with JS code '"" + window'. It shows 'WARNING:
> > Script threw exception: TypeError: No default value' at the console.
> > Doing 'alert(window)' correctly shows '[object Window]'.
>
> The window object is the most special object of all (as it's the global
> object as well). I've added this case as a test to
> khtmltests/ecma/location.html. Will look into this at home. Should be easy
> to fix.

Thanks!

>
> Question: have you encountered this problem in a real world web page ?

Only if I'm part of it ;). Anyway, window.toString also doesn't exist.

Btw, the same exception is thrown doing a
'window=="I'm a string, not a window"', which isn't such a strange test
to do IMO. (Of course it should always return false, even if
'window=="[object Window]"' is evaluated.)
Hmm, that funny 'document=="[object HTMLDocument]"' returns 'true'. Should
it?

Koos






More information about the kfm-devel mailing list