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

171
Views
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 answers
Answer question

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 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!