Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
SVG.js ¿Cómo agrego un svg a la página HTML?

Tengo una página que mostrará varias imágenes svg que se generarán a partir de datos json. Creé una clase de javascript que generará el svg pero no sé cómo agregarlo al dom.

Como un ejemplo simple:

 <html> <body> <div class="myrow"> *i want to add the image here* </div> </body> </html

Intenté algo como:

 let x = new mysvgobject(json); x.img.addTo('.myrow');

pero no funciona Creo que necesito convertir ese x.img en algo que el HTML entienda, pero no sé qué podría ser. Cualquier ayuda sería apreciada.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Encontré la respuesta. Solo tuve que profundizar más en el svg producido por la clase con:

 x.img.node.outerHTML

y colóquelo en la página.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!