I am working on a notification’s bar that displays all friend requests a user received as well as note’s posted to him etc. So my notification’s bar displays a sum of these recent event’s and on a mouse over that notification’s bar displays the details like friend requests,message’s received,comments posted etc separated by a new line.
echo "<a href='notifications.php?id=all_notifications' class='notification_text' title='".$title."'>"."You have ".$notifications->notification_counter." new notifications!</a> <a class='close_button' href='#' onclick='ajaxcaller_one_param(\"clear_notifications_bar\");return false;'></a>";
The problem is the $title which has all the messages concatenated in it over various if blocks and has \n at the end of each string.
mozilla ignores the \n at the end and places all the messages side by side without a space. how can i eliminate this issue???
The way the title attribute is rendered depends upon/varies with browser. According to this article, Firefox displays the tooltip correctly, ignoring LF and replacing CR with space. I suggest that you use a JavaScript tooltip plugin instead.