I am facing a problem with a javascript which it counts the number of replies in a post:
- Code:
$(function(){
var p = $('.main-head p.h2')[0];
var paging = $('p.paging');
var nf = $('.posthead').last().find('h2 strong').text().match(/\d+/g)-1;
var link = $('p.paging').not('img').find('a:last').attr('href');
if(!paging) {
$(p).replaceWith('<span class="countpost">'+nf+'</span>');
}else if(paging) {
$.get(link, function(data) {
var nl = $('.posthead:last', data).find('h2 strong').text().match(/\d+/g)-1;
$(p).replaceWith('<span class="countpost">'+nl+'</span>');
});
}
});
This script it doesn't return the number of replies it returns the false value - 1 http://prntscr.com/3sce8m , furthermore I am facing and another problem that I can move the text of this script a little right because its covering the the basic/regular view buttons http://prntscr.com/3sceix .
Last edited by Dark-Avenger on July 7th 2014, 9:01 pm; edited 2 times in total