I want to convert a .csv file to a HTML Table in jQuery. To accomplish that, I'm using a jQuery Plugin called CSVToTable.
The way I used it in my code is as follow:
I called the .CSVToTable('path/to/file.csv') on my
$("#ItemTable").CSVToTable('ItemDatabase.csv', {
loadingImage: 'img/loading.gif',
startLine: 0
});
Everything seemed to work, as well as the loading.gif (which was included in the download).
My first try was running it on the ItemDatabase.csv, which is a .csv that contains approx. 350 lines. It kept loading and loading, and after 15 minutes, I tried it with a smaller file that contains 5 lines. It made no difference.
I looked at the source of
If somebody could tell me what I'm doing wrong, that would be very helpful.
Note: I checked the file paths, and everything is initialized correctly
EDIT: For @sakir, the first 4 lines of my .csv file:
Name,Tier,Kind,Lvl,mDam,xDam,HR,MR,SD,LS,MS,XB,LB
Depressing Bow,Depressing,Bow,1,0,0,NONE,NONE,NONE,NONE,NONE,NONE,NONE
Oak Wood Bow,Basic,Bow,1,4,6,NONE,NONE,NONE,NONE,NONE,NONE,NONE
Birch Wood Bow,Basic,Bow,6,6,10,NONE,NONE,NONE,NONE,NONE,NONE,NONE
解决方案
You can not use file from the local-file system. Please copy your file on the web-server and provide the url to that file in the .CSVToTable(url_file).