I am trying to read a text file using jquery, like this:
// LOAD file and split line by line and append divs
$.get(\'myFile.txt\', function(data) {
v
A workaround for this I used was to include the data as a js file, that implements a function returning the raw data as a string:
check out the data!
// function wrapper, just return the string of data (csv etc)
function getData () {
return 'look at this line of data\n\
oh, look at this line'
}
See it in action here- http://plnkr.co/edit/EllyY7nsEjhLMIZ4clyv?p=preview
The downside is you have to do some preprocessing on the file to support multilines (append each line in the string with '\n\').