当程序文章数越多时内容页点击数显示越慢,有时会影响了网页加载速度,可以用下面方法解决
在article_article.htm模板内找到原来的点击数显示代码
Example Source Code:
<script src=”{dede:field name=’phpurl’/}/count.php?view=yes&aid={dede:field name=’id’/}&mid={dede:field name=’mid’/}” type=’text/javascript’ language=”javascript”></script>
改为
Example Source Code:
<span id=”count”>加载中</span>
然后到网页的最后加上
Example Source Code:
<span id=”count_data” style=”display:none”><script src=”{dede:field name=’phpurl’/}/count.php?view=yes&aid={dede:field name=’id’/}&mid={dede:field name=’mid’/}” type=’text/javascript’ language=”javascript”></script></span>
<script type=”text/javascript”>
document.getElementById(‘count’).innerHTML = document.getElementById(‘count_data’).innerHTML;
</script>
在article_article.htm模板内找到原来的点击数显示代码
Example Source Code:
<script src=”{dede:field name=’phpurl’/}/count.php?view=yes&aid={dede:field name=’id’/}&mid={dede:field name=’mid’/}” type=’text/javascript’ language=”javascript”></script>
改为
Example Source Code:
<span id=”count”>加载中</span>
然后到网页的最后加上
Example Source Code:
<span id=”count_data” style=”display:none”><script src=”{dede:field name=’phpurl’/}/count.php?view=yes&aid={dede:field name=’id’/}&mid={dede:field name=’mid’/}” type=’text/javascript’ language=”javascript”></script></span>
<script type=”text/javascript”>
document.getElementById(‘count’).innerHTML = document.getElementById(‘count_data’).innerHTML;
</script>