XHR stands for XmlHttpRequest object.
This is the traditional way of accessing data asynchronously.
HTML file has a button that we will use to trigger the event.
!DOCTYPE html><html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!--<meta http-equiv="X-UA-Compatible" content-->
<meta name="keyword" content="AJAX">
<meta name="description=" content="AJAX example">
<!-- <script type="javascript" async="" src="js/ajax.js"></script> -->
<title>AJAX Example</title>
</head>
<body>
<div class="container">
<button id="button">Get Data</button>
<br><br>
<div id="output"></div>
</div>
<script src="js/ajax.js"></script>
</body>
</html>
<script src="js/ajax.js"></script>
No comments:
Post a Comment
Please add value. Sharing is caring