I done some svg greasing in the past, and one major gotcha has to do with keeping name spaces straight. You may be creating a html:text node rather than a svg:text node. Without doing any testing on your example, I think you may need to do somethings like: NS=xmlns','http://www.w3.org/2000/svg'; text=document.createElementNS(NS, 'text'); text.setAttribute(NS, 'transform','rotate(90 20 50)');
https://developer.mozilla.org/en/DOM/document.createElementNS https://developer.mozilla.org/En/DOM/element.setAttributeNS On Oct 7, 6:15 am, matteo466 <[email protected]> wrote: > does anyone tried to put an svg code using greasemonkey? > > i try this: > > svg=document.createElement('svg'); > svg.setAttribute('xmlns','http://www.w3.org/2000/svg'); > svg.setAttribute('version','1.1'); > > text=document.createElement('text'); > text.setAttribute('x','20'); > text.setAttribute('y','50'); > text.setAttribute('style','font-size:30px;font-family:Vivaldi;'); > text.setAttribute('transform','rotate(90 20 50)'); > text.innerHTML='notes'; > > document.body.appendChild(svg); > svg.appendChild(text); > > it works fine but the text doesn't rotate. > can anybody resolve this problem? > > p.s. > the equivalent html code works fine: > <svg xmlns="http://www.w3.org/2000/svg" version="1.1" > > <text x="20" y="50" style="font-size:30px;font-family:Vivaldi;" > transform = "rotate(90 20 50)">notes</text> > </svg> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en -~----------~----~----~----~------~----~------~--~---
