简体   繁体   中英

How do I load a .csv file in Tabulator local to the server

I have a file that is updated hourly in the same directory as the.html; however, I am unable to load this csv file to create the table.

        //define table
        var table = new Tabulator("#example-table", {
            ajaxURL:"table.csv", //ajax URL
            progressiveLoad:"load", //sequentially load all data into the table
        });

This results in a CORS policy rejection, and my understanding of

        table.import("csv", ".csv");

is for the user to load a file local to the user, not loading a file local to the server. Am I missing something? I would expect my use case to be more common, but I cannot find a way to create this table from a known file on the server.

To answer my own question, I could not get this table to work with a.csv file, so I edited my Python script to parse a.json from the existing csv and plugged that into Tabulator. This file worked with no further issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM