我必须用JSON数据填充动态表,这是由服务URL给出的,我使用的是Spring + Hibernate,表格我正在提供服务服务URL,请检查我的getData.html文件,请检查它,它是不正常。 我已采用此示例形式here
getData.html
<!DOCTYPE html>
<html>
<head>
<!-- <script>
var t=getTypeFromDOm();
$.getJSON(
url:"localhost:8080/HomeServiceProvider/booking/getAllBookingDetails"
data:{
type:t
},
success: operate(){
$("#table_to_display").datatable();
}
)
</script> -->
<script>
$(document).ready(function() {
$('#table_to_display').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "http://www.service4homes.com:8080/HomeServiceProvider/booking/getAllBookingDetails" // for you it will be - /getWidgetsByType
} );
} );
</script>
</head>
<body>
<div id="table_to_display"></div>
</body>
</html>
我的JSON数据
{
custName: "Navin"
custMobile: "8123456789"
custEmail: "abc@gmail.com"
custAddress: "BAngalore"
}