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

Uncaught TypeError: Cannot read property 'length' of null

错误怎么处理?

1.可能是返回的datagrid数据格式有问题,比如{"total":0,"rows":null},改为{"total":0,"rows":"[]"}就可以了

 

if (capital != null && capital.length < 1) {

posted @ 2017-09-04 18:02  刘俊涛的博客  阅读(30251)  评论(1编辑  收藏  举报