Arduino and ajax?

Good day, need the help of professionals can not understand on what basis is the exchange of data by means of AJAX.
Understand the principle of operation GET Ajax but for the life of me I can not understand... Please explain the principle of operation of the technology.
I have a working example of receiving data from sensors DS18B20, approximately I realize client (the website) sends a request to the server if the GET request includes a part of the code that executes the function:
The piece of code receiving from the;
("GET /temp") != 0) { getTemp(client); }
The export function getTemp
void getTemp(EthernetClient client) {

Js on the client side
the <script>
function getTemp() {
nocache = "&nocache=" + Math.random() * 1000000;
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {
if (this.responseText != null) {
document.getElementById("switch_txt").innerHTML = this.responseText;
}}}}"GET", "temp" + nocache, true);
setTimeout('getTemp()', 1000);

Here is an example to retrieve data and output it for example as text:
<div id="switch_txt">00.00</div>
But what if you need multiple queries to handle for example
1. The control button is pressed
2. Set text values?
June 8th 19 at 17:03
1 answer
June 8th 19 at 17:05
AJAX it from the word "asynchronous".

In one place the code is the query:"GET", "temp" + nocache, true);

elsewhere in the code processes the response:
request.onreadystatechange = function() {
if (this.readyState == 4) { // here and below just check status, they may be different
if (this.status == 200) {
if (this.responseText != null) {
// here the response from the server gets inserted into the HTML
document.getElementById("switch_txt").innerHTML = this.responseText;

what is there to understand? Actually, this whole story of Web technologies to understand what is HTTP Protocol requests as they are processed and why there is AJAX, view the introductory materials on Web development.

Find more questions by tags AJAXArduino