if/else statement on ajax success
I trying to get an counterstat for unread Messages:
The PHP-Code (BubbleStat.php) looks like this:
$totalMsg = $mysql->totalRows("SELECT msg_id from messages WHERE msg_opened = 0 AND msg_receiver = '".$_SESSION["ActiveUserSessionId"]."'");
echo $totalMsgs;
The jQuery code i have this:
$.ajax({
type: "POST",
url: '/BubbleStat.php',
cache: false,
success: function(html)
{
$("#Bubble_Msg").show();
}
});
So how i can get the counter for unread Msgs in #Bubble_Msg ?
It would be nice if the Counter have’nt unread messages to hide the div #Bubble_Msg.
Any idea?
Total Views: 12 Today Views: 0















