常見js報錯

1Uncaught TypeError: Cannot read property 'length' of null 

Uncaught TypeError: Cannot read property 'length' of null前端

錯誤怎麼處理?api

1.多是返回的datagrid數據格式有問題,好比{"total":0,"rows":null},改成{"total":0,"rows":"[]"}就能夠了      //後臺解決post

if (capital != null && capital.length < 1) {}                                  //前端解決blog

相關文章
相關標籤/搜索