Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<title>DataTables example - Child rows (show extra / detailed information)</title>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" class="init"></script>
</head>
<body>
<table id="table-ajax"></table>
<style>
.lnkbtn {
display: inline-block;
padding: 5px;
border-radius: 3px;
background-color: darkgrey;
color: white;
text-decoration: none;
}
</style>
<script>
var nrtodisplay = 3;
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
}
var tbl = $('#table-ajax').DataTable({
"processing": true,
"ajax": {
"url": "datatables-ajax-nr5.json",
"dataSrc": function (data) {
data2 = data.list_data.premium.BTC;
shuffle(data2);
var retdata = [];
for (var i = 0; i < data2.length && i < nrtodisplay; i++) retdata.push(data2[i]);
return retdata;
}
},
"columns": [
{ "data": "name" },
{ "data": "name" },
{ "data": "url" },
{ "data": "creation_date" }
],
"order": [[1, "desc"]],
"columnDefs": [
{
"render": function (data, type, row) {
return Math.round(data / 30.5);
},
"targets": 3
},
{
"render": function (data, type, row) {
var thehtml = '<a class="lnkbtn" href="' + data + '">' + data + '</a>';
return thehtml;
},
"targets": 2
}
]
});
</script>
</body>
</html>