-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (24 loc) · 878 Bytes
/
script.js
File metadata and controls
27 lines (24 loc) · 878 Bytes
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
var queryURL = "https://randomuser.me/api/?results=20&nat=us";
//function displayEmployee() {
$.ajax({
url: queryURL,
method: "GET"
}).then(function(response) {
//console.log(response.results);
var employeeList = response.results;
$('#table_id').dataTable( {
"aaData": employeeList,
"columns": [
{ "data": "name", "render": function ( data, type, row, meta ) {
return data.first + " " + data.last;
}},
{ "data": "picture.thumbnail", "render": function ( data, type, row, meta ) {
return '<img src="'+data+'">';
}},
{ "data": "dob.age"},
{ "data": "email" },
{ "data": "phone" },
]
});
console.log(employeeList);
});