In running an express app, the Jade template includes two script lines:
script(src="https://cdn.socket.io/socket.io-1.3.5.js") <== library
script(src="main.js") <== my code
But when I call something defined in the first script from my JavaScript in main.js, I get the error:
Uncaught TypeError: Cannot read property 'connect' of undefined
The offending line is this one:
var io = io.connect();
Which is defined in the first socket.io script. How can I include that script in a way that my code in main,js can find it?
If this was server side, I'd just 'require' it.