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

前端 未结 9 851
你的背包
你的背包 2021-01-03 20:33

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

io is not defined

How to fix this ?

9条回答
  •  渐次进展
    2021-01-03 21:16

    Wrap your client code on a '$(document).ready()' for jQuery or another library similar function. This way you'll be sure your code runs after the library beeing loaded.

提交回复
热议问题