Regarding self

A

Aaron Gray

Regarding 'self' :-

if (self)
document.write( "self<br>");

if (self === window)
document.write( "self === window<br>");
else if (self == window)
document.write( "self == window<br>");

if (self === document)
document.write( "self === document<br>");
else if (self == document)
document.write( "self == document<br>");

if (window === document)
document.write( "window === document<br>");
else if (window == document)
document.write( "window == document<br>");

IE :-
self
self == window
self == document
window == document

FF, Opera, Safari :-
self
self === window

Aaron
 
A

Aaron Gray

Aaron Gray said:
Regarding 'self' :-

So why use 'self' at all ?

Why not just use 'window' instead for FF, Opera, and Safari ?

Are there some browsers that only support 'innerHeight/Width' on self ?

But then 'document.body.clientHeight/Width' give the same values as
'window.innerHeight/Width' so why use those.

I have only been testing this on the latest versions of the browsers, so I
maybe overlooking older incompatibilities. So if anyone can shed more light
on older browsers behaviour with/without this test page I would be most
thankful

Aaron
 
A

Aaron Gray

Aaron Gray said:
But then 'document.body.clientHeight/Width' give the same values as
'window.innerHeight/Width' so why use those.

I have found 'document.body.clientHeight/Width' may not be very useful
compared to 'window.innerHeight/Width' as on Safari 2.0.4 it is minus
document.body.margin'. And on Konqueror clientHeight/Width is much smaller
than the actual client area.

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top