js get file content code example
Example 1: js get file content from url
// create a variable called content containing the content from https://URL/file
fetch("https://URL/file").then((r)=>{r.text().then((d)=>{let CONTENT = d})})
Example 2: javascript load content from file
//with JQuery
jQuery.get('http://localhost/foo.txt', function(data) {
alert(data);
});