Error Using Socket.io Client Side Files in a Nodejs Project
The first one is socket.io-1.3.5.js
As I understand, you should reference the first file before the second one. But this will result in an error when I run the server:
Uncaught TypeError: object is not a function
And it's refering to this line of the second file:
query[this.timestampParam] = +new Date + '-' + Transport.timestamps++;
I've installed socket.io. What do I do?
The problem I had here, was a rather stupid one. The /socket.io/socket.io.js file and socket.io-1.3.5.js both use a Date class. I had written a script file in my project that also had a line like this: var date = new Date() which was being mixed up with the Date class that those two were using and was casuing this.
It's highly unlikely that anyone encounteres the same problem, but similar cases might happen in any project so I decided to post this here.