首先:非套答案,确实有点看不,确实有点看不明白,求解!functiongetMatchedData(data,match){varresult=data;varattrs=_______;attrs.each(function(obj){result=typeofresult=='object'&&result.hasOwnProperty(obj)?_____:______;});result=typeofresult=="undefind"?"":result;returnresult;}functiontemplateDataMapping(temp,data){if(temp){varmatches=temp.match(/{{[a-z_A-Z](\w+)?([\.][a-z_A-Z](\w+)?)*}}/g);matches.each(function(index,match){temp=temp.replace(match,getMatchedData(data,match.substring(2,match.length-2)));})}returntemp;}
添加回答
举报
0/150
提交
取消