There is a work around to the Firefox 1.0.3 issue, and it is pretty simple. In my haste (and frustration) I seemingly passed over the easiest solution to this problem. I am in the process of updating the existing released code for XWebMenu and XParser. I hope to have newer versions uploaded with updated docs fairly soon (like you haven’t heard that one before hahaha).
I received an email from Brendan Eich, the man given the task to sort out the bug that was found a few days ago. In his email, he gave me another solution - one that I wish I could really use. The code is platform specific to Gecko; and it really got me thinking of what ifs and wishing… really wishing... that Microsoft put oodles of effort into IE7 to make it a developer’s paradise. The code Brendan gave me defines a getter without using __defineGetter__():
Text.prototype.__proto__ = {
get text() {
return this.nodeValue;
},
__proto__: Text.prototype.__proto__
};
Node.prototype.__proto__ = {
get text() {
var cs = this.childNodes;
var l = cs.length;
var sb = new Array( l );
for ( var i = 0; i < l; i++ )
sb[i] = cs[i].text;
return sb.join("");
},
__proto__: Node.prototype.__proto__
};
I rag on and praise both browsers (there’s only two worth using), but I love how there are so many ways you can do one thing in Firefox… even if one of the ways is platform specific.
Also seeing this getter code really makes me wish (and hope; even if it is a stupid hope) that IE7 will sport some form of getter/setter ability in JavaScript. Of course, I don’t want to rely upon branching code to use them (I’m picky, aren’t I?). But one can dream, right?
<sigh /> I want my best-the-web-has-to-offer IE back!