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

449
Vistas
How can I export an object declared in a .ejs file to my index.js

I have a script inside of my .ejs file, the script is very simple, I'm just grabbing the input data from the user and putting inside an object. So, what I want to do is to send this object to my index.js and in my index.js I'm gonna use the data from my object to use in a node module called coap (is very simular to http), but I don't really know how to send my object form a .ejs file to my index.js file which I'm using the express module.

const btnSubmitData = document.getElementById("btnSubmitData")
btnSubmitData.addEventListener("click", () => {

    const boardIP = document.getElementById("BoardInputIP").value
    const boardMethod = document.querySelector('input[name="inlineRadioOptions"]:checked').value
    const boardFunction = document.getElementById("selectFunction").value
    const boardPoint = document.getElementById("selectPoint").value

    const inputDataBoard = {
        ipBoard: boardIP,
        methodCoapBoard: boardMethod,
        functionBoard: boardFunction, 
        pointBoard: boardPoint
    }


    })
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

don't you have to use ejs to display - not index.js?

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