超簡易抓去線上csv檔案中的每一欄 讓前端呈現小工具
Github : https://github.com/kirinchen/parse-online-csv-cell-lite
parse-online-csv-cell-lite
Used to quickly get the one cell value of online csv
可以用在線上的 csv檔 , 像是 google sheet 發布csv到網路上也可以使用
How to use
- import
https://kirinchen.github.io/parse-online-csv-cell-lite/poccl.js
- useed it
fetchCSVCB('https://kirinchen.github.io/parse-online-csv-cell-lite/demo_color_srgb.csv',0,1,cell=>{
// cell is value
});
Parameters
- url : csv file url
- pox : csv columns position
- poy : csv rows position
- cb : fetch data callback
example
https://jsfiddle.net/tcfahdqL/13/
code like :
<!DOCTYPE html>
<HTML>
<HEAD>
</HEAD>
<BODY>
This is jQuery App
<div id='rid'></div>
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
<script src="https://kirinchen.github.io/parse-online-csv-cell-lite/poccl.js"></script>
<script >
$(document).ready(function ()
{
fetchCSVCB('https://kirinchen.github.io/parse-online-csv-cell-lite/demo_color_srgb.csv',0,1,cell=>{
alert(cell);
$('#rid').html(cell);
});
});
</script>
</BODY>
</HTML>
留言
張貼留言