Appear update equal to facebook, at the time

0

I have to make a system where the user sends a message and the one who receives it, sees the number 1 on the menu side, at the time the message is received. Like facebook, when you get a notification gets the number 1 on the side of the globe. I wanted to know if anyone has a clue how to do this, I was thinking of doing it using the setTimeOut of jQuery function and making it refresh every 2 seconds to check something new relative to the user it received.

    
asked by anonymous 24.09.2014 / 23:07

2 answers

1

Take a look at websockets. I think it would be the best solution for those systems that need to maintain a real-time server connection.

jQuery for backend connection: link

To answer the socket: link

    
25.09.2014 / 00:25
-3

I recommend you see css patterns like bootstrap or facebook. I already did this using bootstrap. Something like selecting total messages from XXX and putting the result in the tag so that I was equal to the face.

A good tip.

link

    
24.09.2014 / 23:29