原文:解決sweetalert 無故報錯 elem.className.replace Uncaught TypeError: Cannot read property 'className' of null

今天碰到這么一個問題,在使用sweetalert的時候時有時無會報錯 elem.className.replace Uncaught TypeError: Cannot read property className of null 很簡單,debug源碼,發現elem在有時候會為空,為空的時候拋出異常,修改如下代碼即可解決該問題 效果: ...

2017-03-03 22:47 0 3448 推薦指數:

查看詳情

Uncaught TypeError: Cannot read property 'filter' of null

js報錯 Cannot read property 'filter/map' of undefined JavaScript Array filter() 方法 filter() 方法創建一個新的數組,新數組中的元素是通過檢查指定數組中符合條件的所有元素。 要注意的地方 ...

Wed May 20 05:09:00 CST 2020 0 2542
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM