add links to usernames

This commit is contained in:
Lukas Mehl 2019-06-17 17:36:39 +02:00
parent ba0b7e189b
commit 40397d2172

View file

@ -51,9 +51,27 @@
var tbl_body = document.createElement("tbody");
$.each(data, function() {
var tbl_row = tbl_body.insertRow();
$.each(this, function(k , v) {
$.each(this, function(idx , v) {
var cell = tbl_row.insertCell();
cell.appendChild(document.createTextNode(v.toString()));
txt = v.toString();
if(idx == 4 && txt != "--"){
var a = document.createElement('a');
a.appendChild(document.createTextNode(txt));
a.href = "https://www.facebook.com/" + txt;
cell.appendChild(a);
} else if (idx == 6 && txt != "--") {
var a = document.createElement('a');
a.appendChild(document.createTextNode(txt));
a.href = "https://www.twitter.com/" + txt;
cell.appendChild(a);
} else if (idx == 8 && txt != "--") {
var a = document.createElement('a');
a.appendChild(document.createTextNode(txt));
a.href = "https://www.instagram.com/" + txt;
cell.appendChild(a);
} else {
cell.appendChild(document.createTextNode(txt));
}
})
})
$("#datatable").append(tbl_body);