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

292
Vistas
Can I read from an .env file in Javascript?

I'm not using using Node or anything like that, just pure Javascript. I want to read a value that is located in an .env file and display that value on my HTML page. I was able to use the following code to read from a json file that I created, but it would be great if I could reuse the .env file I already have so that I don't have to duplicate the information.

fetch("settings.json")
                .then(response => response.json())
                .then(json => {
                    document.getElementById("project-name").innerHTML=json["project-name"];
                });

If I replace my settings.json file with my .env file this doesn't work because it can't find the file (yes I double checked the location). Any tips?

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