JQuery Ajax

Next ❯HTTP Request Methods

jQuery also provides AJAX functionality

  • It makes AJAX implementation very easy
  • It has several predefined methods for AJAX, which are easy to use
  • But required jQuery library file
  • Tips! Before moving to the JQuery Ajax, you must learn at least a little JQuery, to understand the codes

Example to Just load an external file :


I am a 'div' element

$("button").click(function(){
  $("div").load("ajax_demo.txt");
});
loadsubject
loadclose
<!DOCTYPE html>
<html>
<head>
<title>Full Code</title>
<!--Required jQuery Library File -->
<script src="jquery.min.js"></script>
<script>
 $(document).ready(function(){
  $("button").click(function(){
    $("div").load("ajax_demo.txt");
  });
 });
</script>
</head>
<body>
   <div>I am a 'div' element</div><br>
   <button>Load File(ajax_demo.txt)</button>
</body>
</html>

For more Try jQuery Ajax


  • HTTP Request Methods
❮ Prev Ajax Events
Next ❯HTTP Request Methods
TryOut Examples"Learn to Explore..!"

TryOut Editor

receipt