0

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.

2
Contributors
1
Reply
12
Views
2 Years
Discussion Span
Last Post by Eagle.Avik
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.