-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdaily.html
74 lines (70 loc) · 2.68 KB
/
daily.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.3.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/r/dt/dt-1.10.22/datatables.min.css" />
<script type="text/javascript" src="https://cdn.datatables.net/r/dt/dt-1.10.22/datatables.min.js"></script>
<script>
$(document).ready(function () {
$('#jobs tfoot th').each(function () {
var title = $(this).text();
$(this).html('<input type="text" placeholder="Search ' + title + '" />');
});
getDataForDatatables();
});
function getDataForDatatables() {
var test = "https://raw.githubusercontent.com/crypto-jobs-fyi/crawler/main/jobs_new.json";
var jd = $.getJSON(test, {
format: "json"
})
.done(function (jsonData) {
setDataToTable(jsonData);
});
}
function setDataToTable(jsonData) {
$('#jobs').DataTable({
pagination: "bootstrap",
filter: true,
data: jsonData.data,
destroy: true,
lengthMenu: [50, 100, 250, 500],
pageLength: 50,
initComplete: function () {
this.api()
.columns()
.every(function () {
var that = this;
$('input', this.footer()).on('keyup change clear', function () {
if (that.search() !== this.value) {
that.search(this.value).draw();
}
});
});
},
"columns": [
{ "data": "company" },
{ "data": "title" },
{ "data": "location" },
{ "data": "link" }
]
});
}
</script>
<table id="jobs" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Company Name</th>
<th>Job Title</th>
<th>Location</th>
<th>Apply Link</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Company Name</th>
<th>Job Title</th>
<th>Location</th>
<th>Apply Link</th>
</tr>
</tfoot>
</table>