I'm making a site which should (a) take information from the user in the form of files and forms, (b) take that data to the server to be run on a C application, and (c) take the result back and show it to the user. I was told to look for AJAX for the communication with the server. BTW, I'm using rails.I'm trying to understand how AJAX works. From what I understand so far, with rails is pretty easy to make the call.What I can't figure out is, what waits for that call? what process the call?If I understand correctly, with rails I could make a function in ruby and make it so it's called through AJAX, which means -or so I understand- that it gets executed on the server. If I were using PHP, would I need to make an http server to wait for the AJAX calls?I just don't find information about what waits for the call, and that information is processed. Any links, comments or books are welcome!
what receives an ajax call?
ruby on rails;ajax
This is an oversimplified answer, based on what I think your current understanding is. If it's too trivial or too complex, feel free to tell me about it and I'll expand or clarify.An AJAX request is a normal HTTP request. You are essentially requesting a resource from the web server, and technically it's exactly the same request as if you'd type the URL of the resource in the address bar of your browser. What's different with AJAX requests is than they can be executed asynchronously. A trivial explanation of what that means is that you don't need to reload the page for the requests to happen. So, the difference is solely on the client side. On the server side, the HTTP Server doesn't treat them any differently than normal HTTP requests, it listens for requests, and serves resources when asked. These resources can be anything, an HTML script, a PHP script, a Ruby script, any kind of media, etc.Lastly, your choice of server side language doesn't really matter, the architecture is the same.