今天在使用jquery.jqGrid.min.js时 弹出错误提示
Grid can not be used in this ('quirks') mode!
查看源码后发现
if(document.documentMode !== undefined ) { // IE only
if(document.documentMode <= 5) {
alert("Grid can not be used in this ('quirks') mode!");
return;
}
}
其中document.documentMode值 查资料后解释如下
除ie8以外的任何浏览器上返回的值是undefined.
ie8上面如果页面没有标准头的话,返回值为5。
ie8上面如果页面有标准头的话:
将返回7或者8,确定使用的是ie7渲染模式或者是ie8渲染模式。
寻思了下 估计是文件头这类问题
仔细与其他文件对比后
增加<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> 对于文档声明后 不报此错