jQuery AJAX Intro
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> </head> <body> <button id="loadBtn">Load Greeting</button> <div id="output"></div> <script> $("#loadBtn").click(function() { $.get("greeting.txt", function(data) { // 'data' holds whatever the server sent back $("#output").text(data); }); }); </script> </body> </html>