Hi I am working on a project and am using express and socketio to construct a website. When I get to index.ejs I get a variable called LocalName that I wish to use in a javascript file linked to index.ejs.
This code is used when creating the variable:
app.get('/', checkAuthenticated, (req, res) => {
res.render('index.ejs', { LocalName: req.user.name })
})
This is what I wish to do with the variable:
const messageInput = document.getElementById('message-input')
const message = string(LocalName) + ": " + string(messageInput.value)
I have tried using getelementbyBLANK but it does not work.