Cara Menampilkan Jumlah Posting dan Jumlah Komentar pada Blogger
Tambahkan sebuah elemen halaman HTML/JavaScript, kemudian letakkan kode ini di dalam formulirnya:
<script>
function showPostCount(json) {
document.write(parseInt(json.feed.openSearch$totalResults.$t, 10));
}
</script>
<p><script src="/feeds/posts/summary?max-results=0&alt=json-in-script&callback=showPostCount"></script> Posting & <script src="/feeds/comments/summary?max-results=0&alt=json-in-script&callback=showPostCount"></script> Komentar</p>
Klik Simpan.
Labels: Blogger, JavaScript, Widget
5 Comments:
kenapa altnya gak bisa diterjemahin yah mas? :(
Template Anda tidak dapat diparse karena tidak well-formed. Harap pastikan bahwa semua elemen XML ditutup dengan benar.
Pesan error XML: The reference to entity "alt" must end with the ';' delimiter.
By Putra, at Tuesday, March 20, 2012 at 4:30:00 PM GMT+7
@Taufik NurrohmanKenapa tetep gak bisa yah mas :(
-results=0&alt=json saya ganti -results=0&alt;=json
script&callback saya ganti script&callback
setelah berhasil disimpan, pas tak buka malah gak ada jumlah komentarnya :(
padahal yg komentar 2
By Putra, at Wednesday, March 21, 2012 at 11:44:00 AM GMT+7
@Alam Perwira Coba ganti dengan ini:
<div id="counter">
<script src="/feeds/posts/summary?max-results=0&alt=json-in-script&callback=showpostcount"></script> Posting & <script src="/feeds/comments/summary?max-results=0&alt=json-in-script&callback=showpostcount"></script> Komentar
</div>
By Taufik Nurrohman, at Wednesday, March 21, 2012 at 2:35:00 PM GMT+7
@Taufik Nurrohmanmancaaaaap, berhasil.. :D
thanks berat lg mas ilmunya keren2 :)
By Putra, at Thursday, March 22, 2012 at 4:41:00 PM GMT+7
makasih infonya
By Unknown, at Thursday, March 28, 2013 at 12:14:00 PM GMT+7
Post a Comment
<< Home