AJAX Applications

AJAX Real-World Applications

By combining everything we have learned, we can build robust, highly interactive web applications.

AJAX is used extensively across the modern internet for various features you interact with daily.

Refresh your knowledge on the basics in our AJAX Introduction tutorial.

Common AJAX Use Cases


Building an Interactive App

In a professional environment, an AJAX application combines HTML buttons, JavaScript event listeners, and backend APIs.

You request JSON or XML data, parse it, and completely manipulate the DOM elements on the screen.

Application Example:

function loadAppDashboard() {
  const xhttp = new XMLHttpRequest();
  xhttp.onload = function() {
    const data = JSON.parse(this.responseText);
    // Building a complex application view dynamically
    let html = "<h3>Welcome, " + data.username + "</h3>";
    html += "<p>You have " + data.messages + " unread messages.</p>";
    document.getElementById("dashboard").innerHTML = html;
  }
  xhttp.open("GET", "api/dashboard_data.json");
  xhttp.send();
}

Exercise 1 of 1

?

Which modern website feature relies heavily on the core concepts of AJAX?