0
I made a small application with Node + socket.io to send notification. adding the code below on the client page, the notification is displayed in the div "messagebox".
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://localhost:4555/socket.io/socket.io.js"></script>
<script>
var socket = io('http://localhost:4555', {transports: ['websocket', 'polling', 'flashsocket']});
socket.on('notificacao', function (data) {
document.getElementById('messagebox').innerHTML = data;
});
</script>
<div id="messagebox">
My question now is how to make those notifications appear in the facebook style. or to be clearer equal to the pushcrew notifications.
I haven’t found anything that can help me :/ someone has some material or knows how I can do it ?
I didn’t understand what you want exactly, could explain better?
– Rafael Augusto
@Rafaelaugusto Good morning Rafael yes, next... the way I did, as soon as I triggered the notification it appears on the page by div MESSAGEBOX but I would like instead to appear in div, appears this way here --> prntscr.com/joj5xi I could not do it :/
– André Luiz Mardonis
What you want is to use the
HTML
,Notification
take a look https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API– Rafael Augusto
@Rafaelaugusto had already seen this documentation, but I could not integrate with my application, due to lack of more advanced knowledge on the subject :/ even so thank you.
– André Luiz Mardonis
I’ll set a functional example for you
– Rafael Augusto
@Rafaelaugusto ta joia, thanks man :)
– André Luiz Mardonis
@Rafaelaugusto can check what is wrong with this code --> http://prntscr.com/jokj9q. when sending the notification appears the alert to accept, the notification appears on the console, but it is not displayed as I said it --> http://prntscr.com/joj5xi
– André Luiz Mardonis