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

127
Vistas
anaconda enterprise python read external json in HTML

My python code creates HTML files. I work on Anaconda Enterprise and my problem is that I want to read an external json file in javascript encapsulated in HTML

message = """
    <!DOCTYPE html>
    <html>
        <head>
            <script type="text/javascript" src="sample.json"></script>
        </head>



          <body>
              <p id="GFG_DOWN" style="color: green; font-size: 20px; font-weight: bold;"></p>
            


             <script>
                function pointe_vers_doc(clicked) {
                    var test = document.getElementById("GFG_DOWN");
                    var mydata = JSON.parse(data);

                     test.innerHTML = "Value of my json = "+mydata[0];
                 }
            </script>
        </body>
    </html>
    """

Here is the external json (sample.json) I want to read :

data='[["first", "second"], [], ["fourth"], [], [], ["seventh"]]'

Locally it works but on the server (AE) I think it does not find the path to sample.json I tried to change the path several times by testing but it doesn't work. Is there another way to proceed ?

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