sAjaxSource 不会在 IE 中执行
我在 MVC 应用程序中使用 jquery 数据表服务器端。当我在控制器方法“FillTable”中设置断点时,执行仅在 IE 上第一次到达。如果我返回并重新加载页面并且数据不同,则不会调用该函数。当我尝试使用 Firefox 时,每次重新加载都会遇到断点,没有任何问题。这是我的代码。
$(document).ready(function() {
$('.details').dataTable({
"bServerSide": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "../PrepareStatements/FillTable",
"aoColumns": [
{ "sTitle": "#" },
{ "sTitle": "Date" },
{ "sTitle": "Remarks" },
{ "sTitle": "Dr/Cr" },
{ "sTitle": "Amount"}]
});
});
我的数据表是
<table width="100%" class="details" id="eDataTable"></table>
但是如果我更改显示行数,单击分页或执行搜索,它就会起作用。有人可以帮我解决这个问题吗?
I am using jquery datatables serverside in my MVC application. When I put a break point to my controller method “FillTable” the execution only reaches on the first occasion on IE. If I go back and reload the page and the data is different the function doesn’t get called. When I try Firefox the break point is hit on each reload without any problem. Here is my code.
$(document).ready(function() {
$('.details').dataTable({
"bServerSide": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "../PrepareStatements/FillTable",
"aoColumns": [
{ "sTitle": "#" },
{ "sTitle": "Date" },
{ "sTitle": "Remarks" },
{ "sTitle": "Dr/Cr" },
{ "sTitle": "Amount"}]
});
});
My datatable is
<table width="100%" class="details" id="eDataTable"></table>
But if I change the number of display lines, click on a pagination or perform a search it works. Could someone please help me on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我找到了解决方案。您必须添加 POST,因为 IE 倾向于使用 GET 请求缓存数据结果。我已将以下内容添加到我的函数中,现在工作正常。
Ok i found the solution. You must add a POST as IE tends to cache the data results using GET requests. I have added the following to my function and it works fine now.