Answers for "javascript read.load"

1

html get text from file

<embed src="file.txt"> // This will show the text contained in file.txt in the page
Posted by: Guest on November-14-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
-1

javascript load content from file

//with JQuery

jQuery.get('http://localhost/foo.txt', function(data) {
    alert(data);
});
Posted by: Guest on December-17-2020

Browse Popular Code Answers by Language