Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

448
Views
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 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!