Executing express.js scripts from bootstrap front-end
How would i go about runing some scripts i have written to be run on node server from my web application. I am still trying to figure out how to attach event listener from express app and any info or link to a great guide for that would be appreciated. Anyway, back on question. Is it possible i have like a separate js file attached to my DOM with <link src=""> tag where i import my express scripts and i can execute from DOM using an onClick() attribute.
2/1/2020 5:46:54 AMAntony O. Onyango
4 AnswersNew Answer
Use Post method, and your backend listen to data from frontend, and react accordingly. No use <script src="" > not <link ref="" >, use in the html file.
thanks alot, with some jquery in the dom it was possible to attach an event listener and make the post request back the the express server. Thanks man Gordon
Hi Antony, I think this code is kind of a suitable demonstration on how to use POST to send data to backend for generating content according, just in case you need an example for reference. https://code.sololearn.com/W9d2cR0D6P77/?ref=app