I need your suggestion on something. I want to display a 'message notification' on my menu bar. I want it to be like the Facebook message notification. When I have a new message, '1' should show close to the message menu e.g. 'Message 1' (I can use CSS to style this). Then when I open the message menu and view the 'new message', the '1' should disappear and return to just 'message' on the menu bar. How do I achieve this? I don't know how to do this. Your help will be appreciated.

it is not really so simple and requires a bit of php and jquery knowledge to pull this off perfectly.

here is two way you can di this, one is to use a ajax call to look for changes in the database timely(maybe 10 second interval), but this make unnecessery calls to the server and it can cause heavy load. but for small site this should be fine.

a better way to do this is to use Comet. Facebook use this technology to display real time notification.

http://plugins.jquery.com/project/Comet
https://code.google.com/p/jquerycomet/

it is a bit complex, here is a great SO thread about it:
http://stackoverflow.com/questions/1086380/how-does-facebook-gmail-send-the-real-time-notification

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.