JS自定义的数组对象没有item属性,vfp解析不了。
既然都用到JS了,可行的话最好都交给JS去处理,vfp直接调用JS取数就好了,这样效率也高点。
既然都用到JS了,可行的话最好都交给JS去处理,vfp直接调用JS取数就好了,这样效率也高点。
TEXT TO jsCode NOSHOW var data_1={"traces":[{"accepttime":"2016-12-03 12:24:25","acceptaddress":"宿州市","remark":"宿州市邮政速递公司北区揽投部已收件(揽投员姓名:陆登杰,联系电话:18955780863)"},{"accepttime":"2016-12-03 18:45:11","acceptaddress":"宿州市","remark":"离开宿州市 发往蚌埠市"},{"accepttime":"2016-12-03 21:13:10","acceptaddress":"蚌埠市","remark":"到达蚌埠市处理中心(经转)"},{"accepttime":"2016-12-03 21:14:29","acceptaddress":"蚌埠市","remark":"离开蚌埠市 发往南京市(经转)"},{"accepttime":"2016-12-04 01:31:00","acceptaddress":"南京市","remark":"到达EMS航空集散中心(南京)处理中心(经转)"},{"accepttime":"2016-12-04 06:34:00","acceptaddress":"南京市","remark":"离开南京市 发往北京市(经转)"},{"accepttime":"2016-12-04 08:39:00","acceptaddress":"北京市","remark":"到达 中国邮政速递物流股份有限公司北京市邮件处理中心(航 处理中心"},{"accepttime":"2016-12-04 11:22:04","acceptaddress":"北京市","remark":"离开中国邮政速递物流股份有限公司北京市国货航航空邮件处 发往北京邮政速递上地区域分公司清华营投部"},{"accepttime":"2016-12-04 13:23:00","acceptaddress":"北京市","remark":"北京邮政速递上地区域分公司清华营投部安排投递,预计23:59:00前投递"},{"accepttime":"2016-12-04 15:50:40","acceptaddress":"北京市","remark":"投递并签收,签收人:本人收"}]}; endtext **********************************************注意要把JSON中的字段名称转换为小写************************** js = CREatEOBJECt("ScriptControl") js.Language = "JavaScript" js.addCode(jsCode) json = js.CodeObject.data_1 FOR i=0 TO json.traces.length-1 ?js.eval("data_1.traces["+ALLTRIM(STR(i))+"].remark") ENDFOR