代码

document.geyElementById('nonexisting').classList.add('foo')

报错

“Cannot read property 'classList' of null” when using classList.add

原因

没有 document.geyElementById('nonexisting')  nonexisting 不存在

解决办法  增加 nonexisting id属性

“Cannot read property 'classList' of null” when using classList.add相关推荐

  1. Cannot read property 'nodeType' of null; audio元素默认样式下载按钮

    1.chrome-->console抛出如下错误: Uncaught TypeError: Cannot read property 'nodeType' of null 错误原因:从stack ...

  2. 删除数据 DataIntegrityViolationException: not-null property references a null or transient value解决...

    今天在做删除某一个数据时 使用hibernate的getHiberbnateTemplate().delete(entity)时,报以下错误 javax.servlet.ServletExceptio ...

  3. echarts Cannot read property ‘getAttribute‘ of null 问题的解决方法

    echarts Cannot read property 'getAttribute' of null 问题的解决方法 参考文章: (1)echarts Cannot read property 'g ...

  4. Uncaught TypeError: Cannot read property 'setAttribute' of null

    Uncaught TypeError: Cannot read property 'setAttribute' of null 其实就是js中空指针异常 h5splayer.js:1 Uncaught ...

  5. 项目中遇到Cannot read property 'length' of null

    错误页面: 本人遇到的这个错误的原因主要是后台返回给页面的数据错误,没有数据时我返回给前台页面的是null,所以这个时候前台就会报这个Cannot read property 'length' of ...

  6. Vue+G2:Please specify the container for the chart! + Cannot read property ‘appendChild‘ of null

    研究了一下午,终于搞懂了是为啥. 先看一下代码,两个tab标签页,其中一个放chart的挂在节点,但是初始化的时候一直报两个错. <a-tabs default-active-key=" ...

  7. Uncaught TypeError: Cannot read property 'value'' of null

    在用JS实现ajax做网页聊天室的时候,报了一个错误: Uncaught TypeError: Cannot read property 'value'' of null at chat (Gluti ...

  8. hibernate异常:not-null property references a null or transient value

    http://blog.163.com/xiexueyong1987@126/blog/static/1262673422009106103128236/ 调用delete()时,出现Property ...

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

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

最新文章

  1. 解决在SQL Server 2000的存储过程不能调试
  2. 关于《指针的艺术》看书时所遇到的问题
  3. metasploit 快速入门(三) 服务端漏洞利用
  4. 我的个人小站,欢迎大家吐槽
  5. 在每天下午5点使用计算机时,网络信息安全知识网络竞赛试题(附答案)讲解学习...
  6. python jieba库用法
  7. java图片压缩不失真_软件分享 | Lit图片压缩
  8. java识别系统_[Java教程]Java识别操作系统
  9. python list清理列表中的空元素或特定元素
  10. 普通账户信息是SIEM的盲点
  11. PHP获取随机字符串的两种方法
  12. Go语言栈定义及相关方法实现
  13. HSQL转换成MapReduce过程
  14. linux命令unzip,linux unzip命令参数及用法详解--linux解压zip文件命令
  15. Android_JNI编程入门
  16. LOAP引擎:clickhouse06:简单介绍几个JSON函数
  17. 74HC573并联输出
  18. 小程序如何开通流量主
  19. const、*、的大乱斗
  20. 关于投资有哪些不得不读的书籍?

热门文章

  1. JAVA与计算机语言基础概述
  2. Vue.js 2.x 教程(2)
  3. word另存为html文件后,浏览器打开不显示图片
  4. Java经典排序算法的含义解析
  5. OPPO Android8刷机包.0,ColorOS8.0
  6. springboot+java养老院儿童福利院管理系统
  7. vue echarts x轴文本过长,设置超出隐藏显示省略号,鼠标悬浮上显示全部
  8. :婚姻是一种妥协的艺术
  9. 使用 jQuery Jcrop 实现图像裁剪
  10. stm32的强制转换