socket.io, io is not defined (JS Error)


Question

I have just started with socket.io, its giving JS Error on client page

io is not defined

How to fix this ?

1
22
4/12/2011 2:01:32 PM

Accepted Answer

put <script src="http://yournodeserver/socket.io/socket.io.js"></script> into your code

22
4/12/2011 2:03:20 PM

Alternatively you can use the Socket.io CDN:

<script src="https://cdn.socket.io/socket.io-1.0.0.js"></script>

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon