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

132
Visualizações
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 à 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