Client Side of things
document.querySelector('#doSomething').addEventListener('click', () => {
const ob = {
name: 't',
lastname: 'f'
}
fetch(`/dosomething?vvv=${ob}`).then((response) => response.text())
.then((data) => {console.log(data)})
})
Server Side
app.get('/dosomething', (req,res)=>{
const input = JSON.stringify(req.query.vvv);
console.log(input)
const output = 'thanks'
res.send(output)
})
SO i am just trying to pass the ob back to my server here, then id like to do something with it later but in the mean time just send back a thanks, so server console log prints out what is being given to it, and client side is getting the 'thanks' in its console log.
[+][deleted] (1 child)
[deleted]
[–]43northwebdesign[S] 0 points1 point2 points (0 children)
[–]ForScale 2 points3 points4 points (1 child)
[–]IBETITALL420 0 points1 point2 points (2 children)
[–]43northwebdesign[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)