2004/12/05

I have discovered something that ROCKS:

This example of E4X in use should be enough to convince any ECMAScript coder having to work with DOM that the sooner we get this in Seamonkey, the better. The gentlemen at Mozilla are working on it now, and all power to their elbows.

This me constructing a styled SVG rectangle with the normal DOM API:

var inboundRect = document.createElementNS(SVG_NS, "rect");
inboundRect.setAttribute("class", "borderLink linkRect");
inboundRect.setAttribute("x", -padding);
inboundRect.setAttribute("y", -(textOffset+padding));
inboundRect.setAttribute("width", "0")
inboundRect.setAttribute("height", "15")


This is with E4X:


var inboundRect =
<rect xmlns="{SVG_NS}" class="borderLink linkRect" width="0" height="15" x="{-padding}" y="{-(textOffset+padding)}">


I rest my case. This is already in Rhino, so (*BOUNCE* *BOUNCE*) I can probably use it in Gradient. JOY!