We have defined the functionalities that we are going to Ajaxify. However, before we implement Ajax, we need to understand two points:
What is Ajax
How RoR and Ajax are related
Let us have a look at these points.
Ajax is not a single technology. It is, essentially, a combination of technologies. The term Ajax can be expanded to Asynchronous JavaScript and XML. The keyword here is Asynchronous. Typically, a web page will stop all its work until it receives a response from the server. For such a web page, the communication (sending a request to the server and getting a response from the server) is synchronous. However, if a web page sends the requests and does not wait for the reply to resume processing, then it uses the asynchronous method of communication. Ajax helps developers to implement the asynchronous method of communication using JavaScript.
The XMLHTTPRequest
object of JavaScript can be used to send a request to the server and then do the required changes...