大家好,我一直在寻找很多相关资源来解决我的问题,但是它对我没有用,即使我检查了“jQuery Bootgrid”和许多网站,我仍然没有找到任何很好的例子出来,希望真正了解它的人可以帮助我给我任何细微的线索或任何好的简单。
顺便说一句,
1.我希望我可以使用 Ajax 来更新和查看浏览器和 DB
2 之间的任何修改数据。请给我示例代码
谢谢
一些问题issue
1.Ajax Connection
Front end
<table id="grid-data" class="table table-condensed table-hover table-striped">
<thead>
<tr>
<th data-column-id="id" data-type="numeric">ID</th>
<th data-column-id="sender" data-css-class="sender">Sender</th>
<th data-column-id="received" data-order="desc">Received</th>
</tr>
</thead>
</table>
<script>
var grid = $("#grid-data").bootgrid({
ajax: true,
url: "WebForm3.aspx/x" // link to your web api
});
</script>
后端
public partial class WebForm3 : System.Web.UI.Page
{
[WebMethod]
public static string x()
{
return "";
}
}
留言
Uncaught SyntaxError: Unexpected token < in JSON at position 6
at JSON.parse (<anonymous>)
at Function.n.parseJSON (jquery-2.1.1.min.js:4)
at Object.success (jquery.bootgrid.min.js:6)
at j (jquery-2.1.1.min.js:2)
at Object.fireWith [as resolveWith] (jquery-2.1.1.min.js:2)
at x (jquery-2.1.1.min.js:4)
at XMLHttpRequest.<anonymous> (jquery-2.1.1.min.js:4)