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

207
Views
How to ignore html tags/code stored in JavaScript variables?

Hi I am currently working on a django project wherein I send multiple plotly charts as html code to the client side and try to store this html code in a dictionary I first make the chart and convert to HTML code

prediction_graph = prediction_graph.to_html(full_html=False)

then I send multiple such charts to client side. Here please note that charts itself is a dictionary.

return render(request, 'charts.html', {
                "tickerList": charts["tickerList"],
                "charts": json.dumps(charts)})

On client side I try to store it in a javascript variable

charts = {{ charts|safe }};

However the html tags/code present in this variable causes error. enter image description here

enter image description here

Is there any way to solve this? like make it ignore the html tags/code

about 4 years ago · Juan Pablo Isaza
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!