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 + "]条."; } });

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

  • 相关阅读:
    GCD HDU
    Finding Lines UVALive
    Chinese Mahjong UVA
    DNA Evolution CodeForces
    String Reconstruction (并查集)
    Number Cutting Game HDU
    Paint the Wall ZOJ
    Star sky CodeForces
    Haunted Graveyard ZOJ
    GuGuFishtion HDU
  • 原文地址:https://www.cnblogs.com/zhangxue521/p/15011675.html
Copyright © 2011-2022 走看看