最近做个新闻网站,想在网站后台利用JS函数统计新闻字数,并在前台页面输出值,能实现吗?
就是要在浏览器端“新闻字数”后面输出函数计算的字数值
网页代码如下:
{Stl.SiteName}
<!--头部包含文件-->
/stl:include
<!--页面当前位置导航-->
<div class="breadcrumb">
<stl:location>
<span class="nail"></span>
</stl:location>
</div>
<div class="maincntwrapper1">
<div class="part1 c">
<div class="txtarea">
<h2 class="title"><stl:content type="Title" ></stl:content></h2>
<div class="subinfo c">
<span class="author fl">作者:<stl:content type="Author"></stl:content></span>
<span class="source fl">来源:<stl:content type="Source"></stl:content></span>
<span class="update fl">时间: <stl:content type="AddDate" formatString="yyyy-MM-dd HH:mm:ss"></stl:content></span>
<span class="click fl" >点击:<stl:content type="Hits" isDynamic="true"></stl:content></span>
</div>
<div class="txt" >
<stl:content type="Content"></stl:content>
</div>
<div class="subinfo c" style="border-bottom:0 solid #000000; border-top: 1px solid #cccccc; text-align:right">
<span style="margin-right:5px;" >**_新闻字数:_**</span>
<span style="margin-right:60px;">新闻录入:<stl:content type="AddUserName"></stl:content></span>
<span>责任编辑:<stl:content type="LastEditUserName"></stl:content></span>
</div>
</div>
</div>
<div class="spacerB"></div>
</div>
</div>
<!--底部包含文件-->
<stl:include file="/include/bottom.html"></stl:include>