我有ajax和引導表的問題。 我有一個AJAX JSON我用這種方法叫:ajax引導表json
$(document).ready(function(){
$.ajax({
url: 'php/process.php?method=fetchdata',
dataType: 'json',
success: function(data) {
$('#clienti').bootstrapTable({
data: data
});
},
error: function(e) {
console.log(e.responseText);
}
});
});
我的JSON似乎正確,但該表沒有顯示任何記錄。我究竟做錯了什麼?
這裏也是表定義
<table data-toggle="table" class="display table table-bordered" id="clienti">
<thead>
<tr>
<th>Nome</th>
<th>Cognome</th>
<th>Data Nascita</th>
<th>Provincia</th>
<th>Comune</th>
<th>CAP</th>
<th>Indirizzo</th>
<th>Fisso</th>
<th>Cellulare</th>
<th>Note</th>
</tr>
</thead>
</table>
這也是返回
[{"Nome":"","Cognome":"","DataN":"0000-00-00","Provincia":"","Comune":"","CAP":"","Indirizzo":"","Fisso":"","Mobile":"","Note":""},{"Nome":"Federico","Cognome":"Lupieri","DataN":"2015-09-16","Provincia":"","Comune":"","CAP":"34170","Indirizzo":"Via Ascoli 1","Fisso":"00112233445566","Mobile":"00112233445566","Note":"Vediamo se funziona questo"},
是什麼bootstrapTable()呢?你能提供代碼嗎? – AdamJeffers
看起來像一個構造函數在這裏 http://wenzhixin.net.cn/p/bootstrap-table/docs/getting-started.html 對不起,我不能更具體,但這個類是相當新的我=/ – cristianbregant
而你你的控制檯沒有錯誤嗎? (jQuery等) – AdamJeffers