buen día,niño ruta dentro de SVG uso de JavaScript
Tengo dificultades increíbles en la creación de un camino y mostrar que el uso de "appendChild" dentro de un elemento SVG.
Tengo que estar perdiendo algo críticamente simple ya que he echado sobre las especificaciones de W3C, w3schools.com, varias publicaciones aquí y tratando de hacer ninja google de varias maneras.
Estoy probando en Firefox y Chrome.
Tengo un archivo SVG sencilla así:
<svg xmlns:svg ... id="fullPageID">
<image id="timer1" x="100" y="100" width="100px" height="100px" xlink:href="../component/timer/timer1.svg" />
<image id="battery1" x="200" y="200" width="100px" height="100px" xlink:href="../component/battery/30x20_ochre.svg" />
<script xlink:href="pathMaker.js" type="text/javascript" id="pathMaker" />
</svg>
El guión que estoy tratando de utilizar el siguiente aspecto:
newpath = document.createElementNS("SVG","path");
newpath.setAttribute("id", "pathIdD");
newpath.setAttribute("d", "M 1,97.857143 C 19.285714,96.428571 24.016862,131.64801 90.714286,132.85714 140.78762,133.7649 202.79376,66.16041 202.79376,66.16041");
newpath.setAttribute("stroke", "black");
newpath.setAttribute("stroke-width", 3);
newpath.setAttribute("opacity", 1);
newpath.setAttribute("fill", "none");
document.getElementById("fullPageID").appendChild(newpath);
sólo quiero hacer que algo funcione sencilla. ¿Me equivoco al pensar que no necesito una solución tan complicada como la que se encuentra en Library to generate SVG Path with Javascript??
Gracias Amables.
Es posible que como a 'aceptar' una de las respuestas. – phils