- #1
Jamin2112
- 986
- 12
I was searching around the internet for a procedure to read lines of a text file into a JavaScript array. Most of the procedures I saw used Ajax, which I don't understand yet, so I'll refrain from trying to cut-and-paste code that I don't understand.
I found this
JQuery function call, which does the trick, but how can I get words into the scope outside of the function call? I want to actually be able to use it.
I found this
Code:
$.get('wordsEn.txt', function(myContentFile)
{
words = myContentFile.split("\r\n");
}, 'text');
JQuery function call, which does the trick, but how can I get words into the scope outside of the function call? I want to actually be able to use it.