skip to Main Content

JQuery AJAX GET method request not working

Whenever clicking the button, target file has fetched i.e. "demo.txt" (checked in network) but file content is not displaying, what's wrong? <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#button").click(function(){ $.ajax({url: "http://localhost/suman_php/JQ_AJAX/demo.txt", type:"GET", success: function(data,status){ alert(status); $("#div1").html(data); }}); }); });…

VIEW QUESTION
Back To Top
Search