Use Javascript to open a directory?
How would I use JS to open testing.txt and read what is in it?
(I am using Javascript by having a .html file and using a <script> tag.)
Voters
mamamia5x (77)
You would use the Javascript FS module, but it can't be used in an HTML, CSS, JS repl, it'll have to be used on a NODEJS repl
Coder100 (17035)
@mamamia5x no they don't, they can just make an HTTP request
RohilPatel (1535)
Ur right j*r** (not bad word, his name) @Coder100
Easy! Make an HTTP request! (Note you won't be able to write)
This is what happened:
https://repl.it/@isaiah08/TrustingUnfoldedLeads#[email protected]
nooo you can't use it like that @isaiah08
ugggh ig you don't know what promises are. You see, it takes some time to load the file, and JS doesn't like that, so it returns something called a promise, which will get resolved later on. What you want is:
@isaiah08
Also, you forgot to set the type of the output lol
Thank you! @Coder100
No problem! @isaiah08