I read the file with the object xmlHttpand split it responseTextinto new lines by the split method.
But the character "\ n" literally does not work. It acts like an error in my code and causes my code to not even function. Here is the line:
var lines=myPlaylist.responseText.split("\n");
There is no error if I split the myPlaylist array into other characters. Just \ n causing a problem that I don't understand.
At first, I thought the error was related to white space: nowrap, since I am executing my code in Chrome. Although I never used white space anywhere, I tried to set it to normal, but that didn't work. Similarly, I tried my code in other browsers (Firefox, IE, etc.), It didn’t work either. Looks like I'm having a problem using \ n. Is there any other way to use a new line or an error with my code?
And by the way, the error seems to be a syntax error, since it does not just ignore the \ n character. Just makes my code not work
EDIT: ExampleresponseText
[playlist]
File1=http://localhost:7000/Videos/Big%20Buck%20Bunny%20Trailer.ogv
Title1=Bunny Trailer
Length1=23
File2=http://localhost:7000/Videos/Dizzy%20Cat%20Video.ogv
Title2=Kedi
Length2=33
NumberOfEntries=2
Version=2
source
share