timer/public/js/main.js

17 lines
330 B
JavaScript
Raw Normal View History

2012-06-05 09:07:51 +03:00
var socket = io.connect(window.location.hostname);
2012-06-05 08:45:50 +03:00
socket.on('time', function (data) {
$('#countdown').html(data.time);
});
$('#start').click(function() {
socket.emit('click:start');
});
$('#stop').click(function() {
socket.emit('click:stop');
2012-06-05 08:45:50 +03:00
});
$('#reset').click(function() {
socket.emit('click:reset');
2012-06-05 08:45:50 +03:00
});