Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
Keep DOM event handlers when writing an SVG to file

I'm creating an SVG using JSDOM and D3, and then writing it to an SVG file using FS in a Node environment. This SVG has event handlers attached to it for "drag" events, but these handlers are not being preserved in the written file.

How can I keep all event handlers associated with an SVG DOM when writing that SVG to a file?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't think you can serialize event handlers. I would save the parameters of the handler in the html using the dataset property of DOM elements. Then when you reload the svg element you can call an initializer routine to reset the event handlers.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda