I'd like to try to call a function written in C/C++ after clicking a button on a website. For example, say I have a website with an image and a button; after clicking the button, I'd like to run a C routine that maybe performs some filtering (perhaps a lowpass/blur filter) and then updates the image with the blurred image (preferably without reloading the whole website).
My understanding is you can't do this directly in javascript, since it's run on client side. I know you can call C functions with php, but my understanding is that php is parsed/run when the website is loaded, and then php is essentially done (although this may be wrong or incomplete).
So, what general path should I take to call this C function as a button callback, have it run on the server, and then return and update an image. I'd like to stick with just major languages if possible, like php, javascript, maybe jquery or AJAX if need be, etc.