关于前端未获取到区域和店铺类别信息,js中map报错
来源:4-10 店铺注册之js实现
2_02_0
2019-08-18
网页调试报错信息:
SCRIPT5007: SCRIPT5007: Unable to get property 'map' of undefined or null reference
js中的错误定位:
data.shopCategoryList.map(function(item,index){
/shopadmin/getshopinitinfo返回的json数据:
{"areaList:":[{"areaId":1,"areaName":"浦江","priority":1,"createTime":null,"lastEditTime":null}],"shopCategoryList:":[{"shopCategoryId":3,"shopCategoryName":"冰凉一夏","shopCategoryDesc":"这个夏天,你值得拥有","shopCategoryImg":"test2","priority":0,"createTime":null,"lastEditTime":null,"parent":null}],"success":true}
写回答
1回答
-
同学好,需要在chrome开发者模式下(不是在Eclipse),调试一下data.areaList以及data.shopCategoryList是否是undefined,如果是,需要去到源头看看,虽然后端能返回店铺类别以及区域列表信息,但是为什么没有赋值给data.areaList
022019-08-19
相似问题