TypeError: Cannot red property 'style' of null 错误解决
错误信息如下:
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 错误解决的更多相关文章
- day01-JavaScript中"Uncaught TypeError: Cannot set property 'innerHTML' of null"错误
转行学开发,代码100天.初写了最简的一段Js代码,即通过document中的innerHTML方法修改一个<p>标签的内容,报以下错误. -"Uncaught TypeErro ...
- Uncaught TypeError: Cannot read property 'length' of null错误怎么处理?
Uncaught TypeError: Cannot read property 'length' of null 错误怎么处理? 1.可能是返回的datagrid数据格式有问题,比如{"t ...
- JavaScript中"Uncaught TypeError: Cannot set property 'innerHTML' of null"错误
写了一个函数,在调用时出错:"Uncaught TypeError: Cannot set property 'innerHTML' of null" 代码如下: <!DOC ...
- 前台报错:Uncaught TypeError: Cannot read property '0' of null
错误现象: var div1=mycss[0].style.backgroundColor; //这一行提示360和chrome提示:Uncaught TypeError: Cannot read ...
- Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null
在开发Ext 项目中如果遇到 Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null 这个错误,检查下renderT ...
- Uncaught TypeError: Cannot set property 'innerHTML' of null
学习Chrome插件时,要在弹出页面中显示当前时间,结果怎样也显示不出来 看了 http://www.cnblogs.com/mfryf/p/3701801.html 这篇文章后感悟颇深 通过调试发现 ...
- Three.js three.js Uncaught TypeError: Cannot read property 'getExtension' of null
在调试Three.js执行加载幕布的时候,突然爆出这个错误three.js Uncaught TypeError: Cannot read property 'getExtension' of nul ...
- JavaScript Uncaught TypeError: Cannot read property 'value' of null
用 JavaScript 操作 DOM 时出现如下错误: Uncaught TypeError: Cannot set property 'value' of null Uncaught TypeEr ...
- vue-cli +echarts-amap集成echarts和高德地图TypeError: Cannot read property 'dataToPoint' of null解决方案
由于项目的需求,需要做一种迁徙效果, 最后我们采用了组件化开发,可以说这个坑自己一个人踩,有点累,但也收获不少. vue-cli +echarts-amap集成echarts和高德地图,出现报错,错误 ...
随机推荐
- pip使用国内镜像安装各种库
1. 指定阿里云镜像, 安装requirements.txt中的所有 pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-h ...
- ActivityThread 源码分析
ActivityThread是Android Framework中一个非常重要的类,它代表一个应用进程的主线程(对于应用进程来说,ActivityThread的main函数确实是由该进程的主线程执行) ...
- 模块化jQuery的方法
首先有一个格式是这样的 require.config({ paths:{ 'jquery':'libs/jquery-3.1.1', 'swiper':'libs/swiper.js' }}); re ...
- 【Selenium】【BugList7】执行driver.find_element_by_id("kw").send_keys("Selenium"),报错:selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string
[版本] selenium:3.11.0 firefox:59.0.3 (64 位) python:3.6.5 [代码] #coding=utf-8 from selenium import webd ...
- 464. Can I Win
https://leetcode.com/problems/can-i-win/description/ In the "100 game," two players take t ...
- Shell中的数组及其相关操作
http://blog.csdn.net/jerry_1126/article/details/52027539 Shell中数据类型不多,比如说字符串,数字类型,数组.数组是其中比较重要的一种,其重 ...
- tensorflow学习之(十一)将python代码写入文件
#save to file import tensorflow as tf import numpy as np ##(1)Save to file 把相关变量存储到文件中 #remember to ...
- 20175316盛茂淞 2018-2019-2 《Java程序设计》第9周学习总结
20175316盛茂淞 2018-2019-2 <Java程序设计>第9周学习总结 教材学习内容总结 下载安装MySQL数据库管理系统. 学习<Java程序设计>第十一章MyS ...
- webpack踩坑--webpack 2.x升级至4.x
一.安装webpack-cli,webpack@4.26.1 1.npm install webpack-cli -D 2.npm install webpack@4.26.1 -D 二.踩坑 执行n ...
- 关于字符的C++函数
toupper(), tolower()不会改变原来的字符; 如果输入不是字母, 返回值跟原字符相同. isupper(), islower()..