Probably a very naive question but essentially I am interested in what the title says. There is a node server that was created through http.createServer (serverHandler). The server is presenting a webpage that also has a button. So, the question boils down to: how to send a simple json message to the server when the button is clicked. I mean what sort of javascript code do I need on the webpage in order to send a message / http request to the server?
Assume the message is sent to the address "button.json" and hence it will be received by the node server and handled appropriately (say it prints a message through console.log).