Cannot read property 'replace' of null
程序员文章站
2022-03-04 11:02:50
...
var dateStr = this.userBirthday.replace(/-/g, "/");//现将yyyy-MM-dd类型转换为yyyy/MM/dd
出错 this.userBirthday
为ajax返回来的json数据$.each取出数据库的一个userBirthday字段
这个字段在后台数据库中的值有null 有null就报错
上一篇: Java8 Optional 随笔
下一篇: Java8中Optional详解
推荐阅读
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object
-
npm ERR! Cannot read property 'path' of null
-
js报错 Cannot read property 'getAttribute' of null
-
微信小程序报Cannot read property 'setData' of undefined的错误
-
webpack报错Cannot read property 'presetToOptions' of undefined
-
Extjs4---Uncaught TypeError: Cannot read property ‘items’ of undefined
-
JavaScript Uncaught TypeError: Cannot read property 'value' of null
-
Cannot read property 'tap' of undefined
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#
-
Property or field ‘XXX‘ cannot be found on null