Parse a SRT file with jQuery Javascript
Clash Royale CLAN TAG #URR8PPP Parse a SRT file with jQuery Javascript I'm trying to parse .srt but I get an internal error and I can't figure out what is it. .srt Here is my code: var subtitles; jQuery.get('SB_LKRG-eng.srt', function(data) { //alert(data); function strip(s) { return s.replace(/^s+|s+$/g,""); } srt = data.replace(/rn|r|n/g, 'n'); //alert(srt); srt = strip(srt); //alert(srt); var srt_ = srt.split('nn'); alert(srt_); var cont = 0; for(s in srt_) { st = srt_[s].split('n'); alert(st); if(st.length >=2) { n = st[0]; i = strip(st[1].split(' --> ')[0]); o = strip(st[1].split(' --> ')[1]); t = st[2]; if(st.length > 2) { for(j=3; j<st.length;j++) t += ...