Javascript 充足的身体)。。。。你可以在我的帖子里看到。问题是它正在打电话,但无法填满第二张桌子。这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计,这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计,
Javascript 充足的身体)。。。。你可以在我的帖子里看到。问题是它正在打电话,但无法填满第二张桌子。这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计,这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计, ,javascript,jquery,json,datatables,Javascript,Jquery,Json,Datatables,充足的身体)。。。。你可以在我的帖子里看到。问题是它正在打电话,但无法填满第二张桌子。这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计,这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计, { "count": 87, "next": "https://swapi.co/api/people/?page=2", "previous": null, "results": [ { "name": "L
充足的身体)。。。。你可以在我的帖子里看到。问题是它正在打电话,但无法填满第二张桌子。这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计,这很好,只是尝试了我的文档,效果非常好,最后它是一件非常简单的事情哈哈,谢谢,伙计,
{
"count": 87,
"next": "https://swapi.co/api/people/?page=2",
"previous": null,
"results": [
{
"name": "Luke Skywalker",
"height": "172",
"mass": "77",
"hair_color": "blond",
"skin_color": "fair",
"eye_color": "blue",
"birth_year": "19BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/",
"https://swapi.co/api/films/7/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [
"https://swapi.co/api/vehicles/14/",
"https://swapi.co/api/vehicles/30/"
],
"starships": [
"https://swapi.co/api/starships/12/",
"https://swapi.co/api/starships/22/"
],
"created": "2014-12-09T13:50:51.644000Z",
"edited": "2014-12-20T21:17:56.891000Z",
"url": "https://swapi.co/api/people/1/"
}
var table = $('#example').DataTable( {
"columns": [
{ "data": "name" },
{ "data": "height" },
{ "data": "hair_color" },
{ "data": "skin_color" },
{ "data": "gender" }
]
} );
$.ajax({
url: 'https://swapi.co/api/people/',
dataType: 'json',
success: function(json){
table.rows.add(json.results).draw();
}
});
$('#example tbody').on('click', 'tr', function () {
var data = table.row( this ).data();
alert( 'You clicked on '+data.url+'\'s row' );
$.ajax({
url: data.url,
dataType: 'json',
success: function(json){
tableDos.rows.add(json.name).draw();
}
});
} );
{
"name": "Luke Skywalker",
"height": "172",
"mass": "77",
"hair_color": "blond",
"skin_color": "fair",
"eye_color": "blue",
"birth_year": "19BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/",
"https://swapi.co/api/films/7/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [
"https://swapi.co/api/vehicles/14/",
"https://swapi.co/api/vehicles/30/"
],
"starships": [
"https://swapi.co/api/starships/12/",
"https://swapi.co/api/starships/22/"
],
"created": "2014-12-09T13:50:51.644000Z",
"edited": "2014-12-20T21:17:56.891000Z",
"url": "https://swapi.co/api/people/1/"
}
var tableDos = $('#exampleDos').DataTable( {
"columns": [
{ "data": "name" },
{ "data": "gender" }
]
} );
$(document).ready(function() {
var table = $('#example').DataTable({
"columns": [{
"title": "Name",
"data": "name"
},
{
"title": "Height",
"data": "height"
},
{
"title": "Hair Colour",
"data": "hair_color"
},
{
"title": "Skin Colour",
"data": "skin_color"
},
{
"title": "Gender",
"data": "gender"
}
]
});
var tableDos = $('#exampleDos').DataTable({
"columns": [{
"title": "Name",
"data": "name"
},
{
"title": "Gender",
"data": "gender"
}
]
});
$.ajax({
url: 'https://swapi.co/api/people/',
dataType: 'json',
success: function(json) {
table.rows.add(json.results).draw();
}
});
$('#example tbody').on('click', 'tr', function() {
var data = table.row(this).data();
console.log(data);
$.ajax({
url: data.url,
dataType: 'json',
success: function(json) {
tableDos.row.add(json).draw();
}
});
});
});