Home / Computer / What is AJAX? Understanding AJAX And ​​Function & How It Works (Complete)

What is AJAX? Understanding AJAX And ​​Function & How It Works (Complete)

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

 Definition of AJAX Is

What is AJAX? AJAX or short for an Asynchronous JavaScript and XML name which is actually not a programming language. But this is a technique that can be made possible to create an interactive website application. If we look at starting from the use of AJAX on a website application where it can communicate with a server in the background. That way it will not affect a whole web page.

The term AJAX was first put forward in 2005 by Jesse James Garret, president and founder of an Adaptive Path company. He even believes that AJAX is a name that makes it easy for clients to interact. This is because if you use the name Asynchronous JavaScript CSS DOM XMHttp Request it will be more difficult to interact.

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.

AJAX Function

 AJAX Function

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

Even though AJAX already has an XML word, there must be a practice in exchanging information or data in modern applications by doing it through JSON. Where JSON is a native format in JavaScript, where the format of writing JSON is almost the same as the format of objects in JavaScript.

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

Besides accepting a JSON string and turning it into a JavaScript object. In general, we often need to send a new data to the server where it comes from a JavaScript object. For problems like this we only need a mechanism in order to be able to convert objects into a JSON string.

How it Works AJAX

 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.
  • XML – for data exchange, whereas XSLT is only for manipulation of a data. Some of developers will replace XML in JSON, this is because their form detects JavaScript.
  • 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.

Loading...

Check Also

10 Best Strategy Games for Android in 2020

Strategy games have been a bit under-rated when compared to the more popular gaming genres …