how to load localt ext file in js

JavaScript
const fileUrl = '' // provide file location

fetch(fileUrl)
   .then( r => r.text() )
   .then( t => console.log(t) )

Source

Also in JavaScript: