Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda