Tag,
ich hab ein Kommentar-Modal wo oben die insgesamten Kommentare stehen und unten alle Kommentare sind.
Wenn ich jetzt ein Kommentar löschen möchte, sollte er oben bei den insgesamten Kommentaren -1 machen. Der zeigt mir aber dann eine 20stellige zahl an xd..
Bild 1 (Normal):
Bild 2 (Wenn ich es -1 machen möchte):
HTML Code:
HTML Code:
<h2 style="margin:1em auto;text-align:center;">(<span class="cc-count-title-<?= $rowFetch['bid']; ?>"><?= (int)$countComments; ?></span>) <?php if($rowCount == 1) { ?> Kommentar <?php } else { ?> Kommentare <?php } ?></h2>
JS:
PHP Code:
// Counter Title //
var counterTitle = $('.cc-count-title-<?= $fs['bid']; ?>');
var parsCounter2 = parseInt(counterTitle.text());
result2 = parseInt(parsCounter2) - 1;
counterTitle.text(result2);
Legende:
$rowfetch['bid'] ( = 115)
$fs['bid'] ( = 115)
Wieso zeigt er mir so eine lange zahl an?