模板字符串中包含需求循环数据。 原本使用的是arr.map (item=lia $ { arr.content }/a/Li )。
这样不符合要求,就打错报告,不说话,上码
$('.con1' ).append (divclass=' con1NR ' style=' width 3360322 px;' divclass=' con1border ' style=' width :302 px;' ul class=' newslist2' id=' ss gvd _1' $ { result.map } item=` liatitle='在会议上的讲话' href='./spech _ common . }改善后
varindexlist=result.map (item={ return ` liatitle=' $ { item.title } ' href='./speech _ common.html? $ { item.id } ' $ { item.content }/a/a ` }.join (' ) $ ).con1' ).append ) ` divclass='con1NR'style ) divclass=' con1border ' style=' width :302 px; ' ul class=' newslist2' id=' ss gvd _1' $ { index list }/Li您可以循环浏览标记,然后将其作为变量放置在模板中/ul /div /div ` )