Simple jquery ajax call to a .txt file

1430689594000 php jQuery

by Start Bootstrap


Here’s the simple ajax call to the text file which would return the content the targeted text fil

Step 1 : Create a new .php and .txt file

Step 2 : In the .php file include the jquery minimal version


 

Step 3 : Introduce a trigger and a result area


 
Get the Result
 

Step 4 : Write a jquery click event

$("#trigger").click(function(){
// ajax call here
});

Step 5 : Place the ajax call over there

$.ajax({url: "demo_test.txt", success: function(result){
$("#result").html(result);
}});

And you’re done !!

Here’s the code that you look for : 

 

Well, i won’t say how to create a text file and put content inside it !!

 

 

 

 


Blog Search
Tags
  • Sysaxiom (4)
  • Github (8)
  • Windows (1)
  • php (25)
  • General Tips (0)
  • GoogleMaps (2)
  • Google App Script (1)
  • Heroku (4)
  • Laravel Middleware (1)
  • xampp (1)
  • Terminal (1)
  • TechCrunch (1)
  • Ubuntu (3)
  • MySQL (2)
Side Widget
can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!