self.parent vs. parent?

Jason Keirstead jason at keirstead.org
Wed Mar 9 16:35:06 GMT 2005


On Wednesday 09 March 2005 11:09 am, David Faure wrote:
> A solution is obviously to use another property name here. If you name it
> nodeParent then you don't run the risk of conflicting with window.parent.

Unfortunately this is a third-party JS library :/

> Really? I'm not sure I would expect that :)
> This function is really related to the node....

I don't know what should happen here as far as the W3C specs, but from my 
experimenting, the scope of the function is certainly *not* inherited from 
the node in Gecko or IE at all - KHTML is the only browser carrying the scope 
that I have access to run a test case on.

For example, try this in Gecko and IE and KHTML:

document.body.onclick = function() {
	alert ( innerHTML );
}

Only in KHTML will you get the innerHTML of the node. In other browsers, you 
get 'innerHTML is not defined' or other simmilar messages.

-- 
If you wait by the river long enough, eventually
you will see the bodies of all your enemies float by.
    - Sun Tzu




More information about the kfm-devel mailing list