Answer the question
In order to leave comments, you need to log in
How to use one socket in different js files on the client?
There is a js file in which the following is connected in the closure:
var socket = io("http://localhost/socket"); //путь условный
var socket = io("http://localhost/socket");
:)
Answer the question
In order to leave comments, you need to log in
Well, check if there is a socket , and if it is, send through it.
Declare it globally in general.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question