js get file content from url

JavaScript
// 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})})
Source

Also in JavaScript: