0
Txt into one variable in JavaScript
Hi Guys!! How to get the whole content of a external .txt in a variable inside your script in order to apply some regular expression?
3 ответов
+ 5
const fileUrl = '' // provide file location
fetch(fileUrl)
.then( r => r.text() )
.then( t => console.log(t) )
+ 3
Ok
+ 1
thank you, I will try it