javascript read.load code example
Example 1: how to load localt ext file in js
const fileUrl = '' // provide file location
fetch(fileUrl)
.then( r => r.text() )
.then( t => console.log(t) )
Example 2: html get text from file
<embed src="file.txt"> // This will show the text contained in file.txt in the page
Example 3: javascript load content from file
//with JQuery
jQuery.get('http://localhost/foo.txt', function(data) {
alert(data);
});