socket.io - ReferenceError: io is not defined

Ness提出了一个问题:socket.io - ReferenceError: io is not defined,或许与您遇到的问题类似。

回答者LuxDieNess给出了该问题的处理方式:

I found the answer for anyone who gets immensely confused by the horrible lack of documentation of socket.io.

You cannot source /socket-lib/socket.io.js,

you must source http://yourwebsite.com:12345/socket.io/socket.io.js.

The server automatically does the rest for you.

希望本文对你有帮助,欢迎支持JavaScript中文网


相关推荐