错误信息如下:

JSP代码如下:

<c:if test ="${not empty excelErrors}">
<div id="excelErrorDiv" class="acxiom-content-container closed rounded vpad top-buffer" style="width:90%;margin-left:5%;">
<div class="acxiom-table top-buffer" style="display:block;width:80%;margin:10% 0% 10% 10%;">
<div id="handlingExcelError" class="row-fluid" style="font-size:20px; display: block;" >
<span style="font-size:20px;">
<font color="#B85F1B"><strong>Warning !!</strong> Importing file has some errors as below:</font>
</span>
</div> <div class="row-fluid" style="font-size:20px; padding-top:50px;">
<div align="center">
<c:forEach var="excelError" items="${excelErrors}">
<table>
<tr>
<td>${excelError} </td>
</tr> </table>
</c:forEach> </div>
</div> </div>
</div>
</c:if>

因为有<c:if >的判断,当excelErrors为空的时候,div不会被加载。

所以js里面的这段话执行就报错了

document.getElementById('excelErrorDiv').style.display = 'block';  

解决办法:

js里面修改为:

if($("#excelErrorDiv")){
$("#excelErrorDiv").hide();
}

TypeError: Cannot red property 'style' of null 错误解决的更多相关文章

  1. day01-JavaScript中"Uncaught TypeError: Cannot set property 'innerHTML' of null"错误

    转行学开发,代码100天.初写了最简的一段Js代码,即通过document中的innerHTML方法修改一个<p>标签的内容,报以下错误. -"Uncaught TypeErro ...

  2. Uncaught TypeError: Cannot read property 'length' of null错误怎么处理?

    Uncaught TypeError: Cannot read property 'length' of null 错误怎么处理? 1.可能是返回的datagrid数据格式有问题,比如{"t ...

  3. JavaScript中"Uncaught TypeError: Cannot set property 'innerHTML' of null"错误

    写了一个函数,在调用时出错:"Uncaught TypeError: Cannot set property 'innerHTML' of null" 代码如下: <!DOC ...

  4. 前台报错:Uncaught TypeError: Cannot read property '0' of null

    错误现象: var div1=mycss[0].style.backgroundColor;  //这一行提示360和chrome提示:Uncaught TypeError: Cannot read  ...

  5. Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null

    在开发Ext 项目中如果遇到 Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null 这个错误,检查下renderT ...

  6. Uncaught TypeError: Cannot set property 'innerHTML' of null

    学习Chrome插件时,要在弹出页面中显示当前时间,结果怎样也显示不出来 看了 http://www.cnblogs.com/mfryf/p/3701801.html 这篇文章后感悟颇深 通过调试发现 ...

  7. Three.js three.js Uncaught TypeError: Cannot read property 'getExtension' of null

    在调试Three.js执行加载幕布的时候,突然爆出这个错误three.js Uncaught TypeError: Cannot read property 'getExtension' of nul ...

  8. JavaScript Uncaught TypeError: Cannot read property 'value' of null

    用 JavaScript 操作 DOM 时出现如下错误: Uncaught TypeError: Cannot set property 'value' of null Uncaught TypeEr ...

  9. vue-cli +echarts-amap集成echarts和高德地图TypeError: Cannot read property 'dataToPoint' of null解决方案

    由于项目的需求,需要做一种迁徙效果, 最后我们采用了组件化开发,可以说这个坑自己一个人踩,有点累,但也收获不少. vue-cli +echarts-amap集成echarts和高德地图,出现报错,错误 ...

随机推荐

  1. mk文件配置第三方jar包,so文件

    #-------------------------配置jar包--------------------- LOCAL_STATIC_JAVA_LIBRARIES := \ libphonenumbe ...

  2. SVN与资源库同步后动作的字母意义

    U:表示从服务器收到文件更新了G:表示本地文件以及服务器文件都以更新,而且成功的合并了A:表示有文件或者目录添加到工作目录R:表示文件或者目录被替换了C:表示文件的本地修改和服务器修改发生冲突

  3. C#的app.Config文件中设置,可以选择执行环境(左配置,有程序),app.Config中的appSettings首字母必须小写,符合源码要求

  4. jq无法获取ng-repeat元素,如何控制ng-repeat元素显示与隐藏?

    之前都是在做微信小程序的页面,最近做一些html页面,页面也没什么效果,就弄了几个点击事件,控制一些元素的显示与隐藏.后面用angular来写这些页面,然后就遇到了问题,就是用ng-repeat生成的 ...

  5. GitHub学习途径

    之前学习GitHub的一个pdf文件 作者是stormzhang 我觉得那个pdf教的很详细,我还没看完,正在学习中,学到了文件的clon和在本机如何更新GitHub的文件. 在此分享一下 下载链接h ...

  6. 数据库基础 RDBMS、NoSQL

  7. 在不安装sqlite3的时候使用sqlite3数据库以及问题/usr/bin/ld: skipping incompatible.....的解决

    在没有安装sqlite3的linux机器上,怎么在不安装的情况下使用sqlite3的数据库呢: 其中只需要2个文件即可: 数据库的动态库libsqlite3.so,sqlite3.h. 另外,一些系统 ...

  8. 关于this的指向

    1.谁调用该函数this指向就指向谁 2.回调函数中this的指向永远都指向window 3.箭头函数指向最近的作用域,箭头函数本身是没有this的指向 4.定时器永远指向window 5.严格模式下 ...

  9. Linux学习---类型修饰符

    auto eg:aoto int a;   默认情况--------->分配的内存可读可写的区域. register eg:register int a; 限制变量定义在寄存器上的修饰符 定义一 ...

  10. ABAP 图形练习(GFW_PRES_SHOW and GRAPH_2D)

    创建屏幕0100(元素清单中含定制控制CONTAINER和OK_CODE) 创建GUI状态100(功能键含BACK和EXIT用于返回和退出 ) 代码 *&------------------- ...