1. 程式人生 > >jqGrid ---Grid can not be used in this ('quirks...

jqGrid ---Grid can not be used in this ('quirks...

今天在使用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"> 對於文件聲明後 不報此錯