// AJAX call
function loadtext(url,divid)
{
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
document.getElementById(divid).innerHTML = this.responseText;
}
xhttp.open("GET", url, true);
xhttp.send();
}
function GetCSVdata(divn,url)
{
var xhttp = new XMLHttpRequest();
xhttp.onload = function() {
str = this.responseText;
rows = str.split("\n");
dis = "<table>";
for (i=0 ; i< rows.length ; i++) {
dis += "<tr>";
cells = rows[i].split(",");
for (j=0 ; j < cells.length ; j++ ) {
dis += "<td>"+cells[j]+"</td>";
}
dis += "</tr>";
}
dis += "</table>";
document.getElementById(divn).innerHTML = dis;
};
xhttp.open("GET", url, true);
xhttp.send();
}
GetCSVdata('MyShowDiv","gk10text.csv");
/*
gk10text.csv content:
A,B,C
1,2,3
4,5,6
*/