By using Ajax, I want to get a click function in a Jade client, which will then be passed to Express in Node.js. After that using Socket.Io, the server will emit a click request to be executed in another HTML client. I tried the following codes, but I got GET ... 404 (Not Found) on the Jade page. Can somebody help me to see which needs to be corrected?
Thank you.
Jade client code:
$(document).bind('pageinit', function() {
$('#buttonA').click(function() {
$.get('/buttonA');
});
});
Server code:
app.get('/buttonA', function (req, res) {
sockets.emit('clickA');
});
HTML client code:
socket.on('clickA', function (data) {
document.getElementById('buttonB').click();
});
via Fanny Febriani Susilo
No comments:
Post a Comment