Answers for "how to load text using js to html"

10

linking a script .js

<script type="text/javascript" src="path-to-javascript-file.js"></script>
Posted by: Guest on March-08-2020
2

how to load localt ext file in js

const fileUrl = '' // provide file location

fetch(fileUrl)
   .then( r => r.text() )
   .then( t => console.log(t) )
Posted by: Guest on June-03-2020

Browse Popular Code Answers by Language