Use Javascript to open a directory?
isaiah08

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.)

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
Coder100

Easy! Make an HTTP request! (Note you won't be able to write)

Coder100

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

isaiah08
Coder100

nooo you can't use it like that @isaiah08

isaiah08

Thank you! @Coder100

Coder100

No problem! @isaiah08