service@xinpop.cn
高校博达网站群网站建设制作中单篇正文代码怎么写?在代码上已经添加了打印和关闭链接.
范例代码如下:
<#list list_news as news>
<!--startprint-->
<div class="news1content" style="padding-top:25px;">
${news.content}
</div>
<!--endprint-->
</#list>
<div style="border-bottom:1px #ccc solid; padding-top:15px;"></div>
<div
align="right" style="padding-top:15px;"><a
href="javascript:doPrint()" target="_self"><span
style="color:#000;font-size:15px;">/ 打印
/</span></a> <a
href="javascript:window.opener=null;window.open('','_self');window.close();"
><span style="color:#000;font-size:15px;">/ 关闭
/</span></a></div>
<script language="javascript">
function doPrint() {
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
window.print();
}
</script>