Message from JavaScript discussions

February 2019

β€” Manual?🀀

β€” 

Quoting the docs:

A new Socket instance is returned for the namespace specified by the pathname in the URL, defaulting to /. For example, if the url is http://localhost/users, a transport connection will be established to http://localhost and a Socket.IO connection will be established to /users.

β€” Https://socket.io/docs/client-api/#IO

β€” So a var chat = io.connect(SERVER + "/chat") is enough?

β€” 

const elem = document
.querySelector('button');

if (elem) {
elem
.addEventListener('click', foo);
}


vs:

const elem = Maybe.of(
document
.querySelector('button'));

elem.map(x =>
x.addEventListener('click', foo));

Message permanent page

β€” I think

β€” I'll try

β€” It's not needed at all, no checks. i mean the data polling / value update

β€” Why you need to check what is already there. just write correct code

β€” Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://file/socket.io/?EIO=3&transport=polling&t=MZYaqiJ. (Reason: CORS request did not succeed).[Learn More]

Message permanent page

β€” You have to enable CORS in your server.

β€” But β€œfile” is your server??