So, I have this strange problem: First, I connect to a socket like this:
window.GLOBAL_socket = io.connect('http://localhost:8080');
Then, if I print out the window.GLOBAL_socket variable, I get a circular variable which contains the property 'connected' which is set true if the connection is succesfull, and false if it isn't as seen in the google chrome console. But when I write the following:
console.log(window.GLOBAL_socket.connected);
It always returns 'false'. Anyone has a clue why this doesn't change? (same happens with the property 'disconnect'; changes when I print out the entire variable, but stays 'true' when printing out the property.
Kind regards,
Zeno
write the followingdo you mean write it in your source file or in google chrome console?