• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

329
Vistas
ReferenceError: document is not defined when using document.getElementById()

code:

    const admin = require('firebase-admin');

const serviceAccount = require("C:/Users/santo/Downloads/bestmpos-firebase-adminsdk.json");

admin.initializeApp({
 credential: admin.credential.cert(serviceAccount)
});

let fs = admin.firestore();
let auth = admin.auth();

start();
async function start (uid, userRecord){
  const info = await fs.collection('users').doc(uid).get();
 console.table(info.data());
 document.getElementById("greeting").innerHTML = "Bonjour";
}

Html code:

<script type="text/javascript" src="app3.js"></script>
    <body>
            <p id="greeting">Hello</p>
        </body>

when I wanted to pass bonjour value by using getElementById() there is a error saying that document.getElementById("greeting").innerHTML = "Bonjour"; ReferenceError: document is not defined

about 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda