Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var log = console.log;
- // var socket = io('https://notification.glitch.me/');
- var socket = io('https://new.wkaliszu.pl:3000');
- var $counter = $('header .liked-container .count');
- var $wrap = $('header .notifications-wrap .notifications');
- var title = $('title').html();
- var notificationCount = parseInt($counter.text());
- var titleCounter = '(' + notificationCount + ') ' + title;
- socket.on('connected', function() {
- log('Połączono z node.js')
- $.post('/gettoken', function(data) {
- var response = parseJson(data);
- if (response === null) {
- return log('Nie udało się otrzymać tokenu.');
- }
- socket.emit('registeruser', response);
- });
- });
- socket.on('registered', function() {
- log('Zautoryzowano.');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement