Wednesday, 2 January 2019

Having one heck of a time, passing data/variables to node and back again

tl;dr: Can't send info from HTML page, then Clientside, then Serverside, and back again.Reason: I don't want the server side to do anything but pass info to and from a database, for example, or to the clientside functions that then sends that to a webpage. I'm trying to make a clear separation code-wise, if that makes any sense. So you'd enter name, press submit, data should go to client.js, then to server.js, then update the DB, then return success/fail message or code.My Problem: How can I get a javascript function to "pass" (and I use this term incorrectly I'm sure) data to node functions?My attempted solutions have failed, and I suspect my incorrect terminology is causing a major barrier when I try to search for information.I briefly thought that if you "require" HTTPS or Express, then you may need to also "require" YourFunctionName.js from the clientside, but then that makes no sense since there's no information there. Then I thought that if it's required, then you can also set it up to listen for that clientside function.thanks for reading, sorry if I'm not making sense, this is really one heck of a barrier for me, and I don't know why.

Submitted January 02, 2019 at 06:52PM by 1foryes

No comments:

Post a Comment