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

251
Vistas
Passing data from flask to Javascript, the format

I'm creating a simple webapp. The backend of this app is build in Flask. I have to pass an array from flask to javascript, to put all the datas into a chart. THe problem is that, when I pass the following array:

[70,50]

Javascript obtain that:

['70', '50']

Here is the code (flask):

@view.route("/journey", methods=["GET", "POST"])
@login_required
def journey():
    #code to elaborate arr
    return render_template("journey.html", user = current_user, data = arr)

Javascript(this is write in a html file, in a script tag):

let data = ('{{ data }}');

I don't know if i'm messing something, or if it is normal. I can see that the number into the array, but I don't know if I must extract it manually, or if there is a better way to obtain the result. Thanks

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