我有一个Kendo UI网格,在IE10/11/Chrome/Firefox中绝对正常。但是,在IE8/9中,它完全无法渲染任何返回的数据。它连接到OData Web Api 2端点。这里是JavaScript:Kendo UI Grid并不在IE8和IE9中显示任何数据
$(document).ready(function()
{
$("#grid").kendoGrid({
dataSource: {
transport: {
read: "http://cross_site_url:port/api/TrackedContainers/get"
},
pageSize: 15,
sort: { field: "EventTime", dir: "desc" }
},
filterable: true,
sortable: true,
pageable: true,
columns: [
{ field: "QrCode", title: "QR Code", width: 100 },
{ field: "Type", title: "Type", width: 150 },
{ field: "Location", title: "Location", width: 200 },
{ field: "Status", title: "Status", width: 90 },
{ field: "FailedCollectionReason", title: "Failed Collection Reason", width: 150 },
{
field: "EventTime",
title: "Event Time",
type: "date",
format: "{0:dd-MMM-yyyy hh:mm:ss tt}",
parseFormats: ["yyyy-MM-dd'T'HH:mm:ss.zz"],
width: 150
}
]
});
});
这一次,IE11的兼容模式似乎准确地模拟现实世界,也未能在设定为IE8文档模式,以显示任何结果。上面的网址显然不是真正的网址 - 它会发起跨站点呼叫,因此我试图在IE8中启用XSS,但无济于事。添加到受信任的站点也没有任何区别。
看看网络流量吧,看起来网格甚至不会在IE8/9中尝试HTTP GET。
任何想法?
您是否将CORS传输添加到jQuery? IE8和9需要使用XDomainRequest对象来执行未包含在jquery中的CORS请求。 –
在document.ready上方,添加$ .support.cors = true; –
这是问题所在。通过添加上述内容来修复。非常 –