Closed Eeems closed 6 years ago
Why do you have a ton of lines that only contain ;
?
I would also suggest merging var statements eg:
var i = 0,
j = 1;
If that is in ReconectingSockets.js thats a third party library I'm importing for some future functionality reasons instead of including as a dependency. It also means I would rather not edit it if I don't have to :D
I would suggest moving all of your code inside a closure and only adding things to the global scope you explicitly want there. ie:
(function(){
// Your code here
window.globalValue = internalValue;
})();
Do i need to call this or just wrap my whole file in that essentially?
Just wrap your whole file. It's self calling. It's basically doing this: (exp)()
Done :D not sure if im keeping reconnecting sockets in the long run so i wont worry about that to much, As for everything else its all in window.onload now. As it was supposed to be.
Could you check this again. I think its much better