Hack Forums
[Javascript] How do I dynamically update my page? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [Javascript] How do I dynamically update my page? (/showthread.php?tid=5735724)



How do I dynamically update my page? - Skidy - Oct 12, 2017

I have seen this alot:

Code
<b>Name: </b>{{=it.something.created}} <i>{{=it.game.lads}}</i>

OR

Code
res.render

https://expressjs.com/en/4x/api.html#res.render - This still confuses me. As I start my server like so:

Code
app.get('/', function(req, res) { //Everything on URL / servers this
    res.sendFile(path.join(__dirname + '/files/index.html'));
});
app.use(express.static(path.join(__dirname, 'public'))); //This serves all the css stuff under the public folder
server = app.listen(8080); //This is passed to the chat

How do I dynamically update something on a page from the Node server?


Oh and I do not want to use sockets for this.


https://www.npmjs.com/package/ejs doesn't uise the same syntax as {{ }}