How do you send information from a client to a server? I kinda need to send some data from the client to server on a button click. Basically, I have this page where there are a couple of buttons, and I want to try to send information about each button (and some extra information about the status of the client, but that's not exactly necessary) to the server when it's pressed. The server should then process that information, and send a processed version to all connected clients.
It's crucial that the client does not refresh because then we would lose the data in the javascript game engine, and the user would have to start over.
Would ajax be appropriate? If it is, can someone include a short, generic example both with the javascript (client side) and Flask (server side) functions / code ?