advice on implementing "dynamic" properties

Harri Porten porten at froglogic.com
Mon Nov 15 07:31:56 GMT 2004


On Sun, 14 Nov 2004, Manos Batsis wrote:

> Up to now, the library only supported IE and Moz. As you probably know,
> Moz provides __defineGetter__ and __defineSetter__ (which, i believe,
> will be in ECMA-262 4th edition),

Correct, although they'll have a different syntax.

> which makes it possible to emulate IE properties like .xml and
> .innerText, for example:
>
> // emulate IEs .xml
> XMLDocument.prototype.__defineGetter__("xml", function (){
>    return (new XMLSerializer()).serializeToString(this);
> });
>
>
> My understanding is that Konqueror does not provide a way to achieve the
> same and it's not really possible for me to interept any change to an
> XML DOM to update such a property. Am i right? Is the definition of a
> new method my only option?

I fear so, yes.

Harri.





More information about the kfm-devel mailing list