In a traditional website usually when we click on a button or maybe a link in a certain way, this will make the browser refresh so that HTML document can be read from the first to the browser screen.
Where this will be a momentary disruption, because the browser has a data request to the web server. That way this will make an application or website less responsive or interactive.
So therefore we recommend that you use AJAX, because this problem can be solved by AJAX. Where AJAX can make an application or website more responsive or interactive. It can even process a request from a server quickly. At this time AJAX became a technology that must be applied to modern websites.
Definition of AJAX
This technique has been around for a long time and it was during this time that Microsoft created an object called XMLHttpRequest which was as a control from ActiveX to the internet. Explorer 5 . AJAX became popular when used intensively by Google and Yahoo.
Development on the web that traditionally can work synchronously between applications and servers. This usually happens when performing an action in the form of a forum, then the browser will send a data to a server. That way the server will respond and also the entire page will be refreshed.
Unlike the web created by AJAX where it only works asyncrounously which means it will receive and request a data from each user on the server. That way without the need to repeat the whole page, but this only makes changes to the web that has been desired.
In general, the functions of AJAX can be seen in its entirety by using objects from XMLHttpRequest which has been provided by a browser. The function you can see starting from:
- Making XMLHttpRequest
- Sending Commands to the Server
- Handling a Response on the Server
If we look at the JSON format, then the function you have to access data through xhr. responseText. This discussion will be discussed in detail from us as shown below:
A. Data Management in JSON
B. Reading JSON as an Object
JSON accepts two parameters, for the first parameter has a function in the form of a string to be converted into an object. Whereas the second parameter accepts the function accompanied by the name of the attribute and the attribute value of a JSON string when read. This function can be run on all attributes of JSON that already exist. So that way we can change a value on the attribute, if desired.
C. Change the Object into a String
How it Works AJAX
As I explained earlier in the understanding of AJAX where AJAX is not a language programming. Where this is one technique for developing a web. Now for how it works you can see the explanation below.
- HTML / XHTML – as CSS and also the main language for displaying data.
- DOM (The Document Object Model) – to display a dynamic data with its interaction.
- XMLHttpRequest – for communicating indirectly or asynschronous. above, it is most likely only be understood when you already know an understanding of basic technical. Hopefully the discussion about the understanding of AJAX and its functions and ways of working above is useful and easy to understand.
Well maybe a little of the discussion above can be understood by you about AJAX. You can understand about AJAX through the discussion below. This is because we discussed it starting from the understanding, function and also the workings of AJAX. Immediately listened to the following discussion.