If i do console.log(socket) i get a socket object in firebug. In the obj I could see a property with id
and i could see the value of the id. But when I do console.log(socket.id) i get undefined. why?
var socket = io();
$(document).ready( function(){
console.log(socket);
console.log(socket.id);
console.log(socket.ids);
$(".click").on("click", function(e){
alert("clicked")
socket.emit("clicked", socket.id)
$(this).addClass("removeclick");
})
});
ps I could get socket.ids
which is 0 but not socket.id.