zoukankan      html  css  js  c++  java
  • 展示博客园顶部的随笔、文章、评论、阅读量统计数据

    在适当位置添加div标签
    <div id="stats_count_show"></div>

    在js脚本中添加如下代码

    function getAllCount() { var post = document.getElementById('stats_post_count').innerText.replace(/.*?(d+).*?/g, '$1'); var article = document.getElementById('stats_article_count').innerText.replace(/.*?(d+).*?/g, '$1'); var comment = document.getElementById('stats-comment_count').innerText.replace(/.*?(d+).*?/g, '$1'); var viewcount = document.getElementById('stats-total-view-count').innerText.replace(/.*?(d+).*?/g, '$1'); post = post != null || post != "" ? post : 0; article = article != null || article != "" ? article : 0; comment = comment != null || comment != "" ? comment : 0; viewcount = viewcount != null || viewcount != "" ? viewcount : 0; document.getElementById('stats_count_show').innerText = "随笔:[" + post + "]篇;阅读量[" + viewcount + "];文章[" + article + "];评论:[" + comment + "]条."; } });

    页面上就有啦,可以适当的调整样式跟位置

  • 相关阅读:
    BZOJ 3677 连珠线
    BZOJ 3676 回文串
    BZOJ 3675 序列分割
    BZOJ 4013 实验比较
    BZOJ 4011 落忆枫音
    使用Google BBR加速 VPS
    OSX编译安装Python3及虚拟开发环境Virtualenv
    OSX安装Mysql8.0
    OpenSSL编程之摘要
    OpenCA搭建
  • 原文地址:https://www.cnblogs.com/zhangxue521/p/15011675.html
Copyright © 2011-2022 走看看