Re: Problem using a script to insert a <use> element
Boris Zbarsky <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.svg |
|---|---|
| Message-ID | <[email protected]> |
Tetra wrote:
> Is it possible to do this? The attached file successfully adds a <rect>
> element, but then fails to add a <use> element with the exact same method.
You're using:
y.setAttribute('xlink:href', '#wtf')
That's wrong. Welcome to XML namespaces!
You need to use setAttributeNS with the right namespace:
"http://www.w3.org/1999/xlink".
For what it's worth, a tool like DOM Inspector would have told you this.
Firebug, sadly, doesn't seem to expose that information.
-Boris