I have a text file called sample.txt and I want to load the data of that file using following HTML file but it would not be loading.
$( document ).ready(function() {
  jQuery.get('sample.txt', function(theData) {
    alert(theData);
  });
});<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1>Alert data from text file</h1>
<div><p id="fileData"></p></div> 
     
    
