Code : Tout sélectionner
function InsertNav() {
var dataSource = 'pages.csv';
$.get(dataSource, function(nav) {
var buildNav = "<div class='nav'>";
var $rows = nav.split("\n");
$rows.forEach(function getvalues(thisRow) {
var columns = thisRow.split(",");
var a = $rows.length;
var sep;
for (a = 0; a < a.length; a++) {
if (a == a.length - 1) {
sep = "";
} else {
sep = " | ";
}
}
buildNav += "<a href='" + columns[2] + "' title='" + columns[1] + "'>" + columns[1] + "</a> ";
buildNav += sep;
console.log("a- " + a);
console.log("$rows.length- " + $rows.length);
})
buildNav += "</div>"
$('#nav').append(buildNav);
});
};