Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

document.getElementByID() in Node.js using express

I would like to know if it’s possible to get an Element by ID using express.

If it’s not possible, I’m using express to transmit data from my website to my node.js server. Is it possbile to get a text input from the user, and then apply that in a node.js variable?

If that’s not possible, I’ll commit to websockets 🙁

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Well, if you want real-time update, then websocket is your only option (instead of sending HTTP request each time user inputs, which will flood your server).

However, if you don’t really need real-time interaction, you can use old-way form POST (or any) method and send HTTP request to your express backend at the end with the data from the form.

Hope this helps!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading