Ajax is a set of web development techniques using many web technologies on the client side to create asynchronous web applications. Using Ajax,web applications can send & retrieve data from a server without reloading the entire page. It is a group of technologies.
When a user loads & clicks a button or fills out a form etc…. JavaScript call goes to XMLHttpRequest object.The Http request is sent to the server by XMLHttpRequest object then Server interacts with the database using PHP,ASP.net etc. Data is retrieved & server sends XML data or JSON data to the XMLHttpRequest callback function. The HTML & CSS data is displayed on the browser.
For learn more visit: https://bit.ly/35mVD9x
$.ajax(url)
The parameters specifies one or more name/value pairs for ajax request.
Example: Change the text of element using an Ajax request:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> <script> $(document).ready(function(){ $("button").click(function(){ $.ajax({ url: "demo_test.txt", success: function(result){ $("#d1").html(result); }}); }); }); </script> </head> <body> <div id="d1"><h2>Change This Text</h2></div> <button>Get External Content</button> </body> </html>
There are several ways to start using jQuery on your website. You can download the
Put jQuery library reference within the head section:
<script src="jquery-3.4.1.min.js"> </script>
Place the downloaded file in the same folder where your file is saved.
jQuery Google CDN:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>
Here is your content of the callout box lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.