jsp页面在浏览器上无法正常显示

页面报错信息:
Uncaught TypeError: Cannot read property ‘options’ of undefined
at _599 (jquery.easyui.min.js:10888)
at HTMLTableElement. (jquery.easyui.min.js:13039)
at Function.each (jquery.min.js:2)
at m.fn.init.each (jquery.min.js:2)
at Object.resize (jquery.easyui.min.js:13038)
at m.fn.init.$.fn.datagrid (jquery.easyui.min.js:12787)
at resizeTableHeightByDPI (baseEquipment.jsp:61)
at HTMLDocument. (baseEquipment.jsp:46)
at j (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
源代码:
$(function() {
initEquipmentData();
resizeTableHeightByDPI();

});
function resizeTableHeightByDPI(){
// var _height = document.body.clientHeight; //右侧datagrid区域的分辨率
var _height = window.screen.height; //浏览器的分辨率
if (_height < 768) {
$(’#equipment’).datagrid(‘resize’,{
maxHeight:‘260px’
});
} else if(_height >= 768 && _height <= 800){
$(’#equipment’).datagrid(‘resize’,{
maxHeight:‘400px’
})
} else if(_height > 800 && _height <= 900){
$(’#equipment’).datagrid(‘resize’,{
maxHeight:‘500px’
})
}
}
原因分析:
必须先初始化数据表格,然后再加载数据表格自适应方法,否则会出现报错

你可能感兴趣的:(日常错误解决记录,制慧链)