Javascript will not (by itself) read a text file. Ajax can possibly be used for that or, if it is on the server, server side scripting.
It is unclear to me what you want to do vs. what you want the script to do. Could you supply more specific information about your project?
In any case, the javascript method split() would most likely come in handy. It's syntax is:
string.split('char');
Where string is a literal quoted value or a variable containing the string value. The char you use would be a character that you want the string to be split on. For example:
Code:
myArray='1 hello,2 how are you,3 goodbye'.split(',');
Would produce an array called myArray with these items:
Code:
myArray[0]='1 hello';
myArray[1]='2 how are you';
myArray[2]='3 goodbye';
Bookmarks