Ajax Introduction

  • AJAX Stands for asynchronous JavaScript and XML
  • It is a technique for creating fast and dynamic web pages.
  • AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server
  • This means that it is possible to update parts of a web page, without reloading the whole page.

What is an Ajax call ?

An Ajax call is an asynchronous request initiated by the browser that does not directly result in a page transition.

A servlet request is a Java-specifc term (servlets are a Java specification) for servicing an HTTP request that could get a simple GET or POST (etc) or an Ajax request.

What is the XMLHTTPREQUEST ?

XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript.

It is used to send HTTP or HTTPS requests to a web server and load the server response data back into the script.

AJAX Example

HTML Page

Note: Create a text file name “load_data.txt” write some contents inside this file, this text file contents will display in <div> after clicking on button