It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Using External Text File

Using External Text File

Postby ranwsn on Fri Jul 16, 2010 5:34 pm

Hey guys,

I'm writing a script and I've encountered a problem..
I have a txt file with many words, each word in a different line.
For example: the file words.txt contains:
word1
word2
word3
word4
word5

I need to load the content of the file into a variable in my script.
I prefer that all the words will be in the same variable with line breaks, but if you'll figure out a way to put it in an array, it's ok too.
I really don't know how to do it, and I tried to google but didn't understand.. By the way, I don't want to change the txt file to js file, I need it to remain txt..

Can anybody help me with that?
Thanks Alot,
Ran
ranwsn
 
Posts: 1
Joined: Fri Jul 16, 2010 5:19 pm

Who is online

Users browsing this forum: No registered users and 10 guests