Closed ghost closed 11 years ago
Thanks :)
It doesn't makes a real difference, but perhaps avoiding string manipulation may be a nanosecond faster! Instead of:
Math.random().toString().replace('.', '-');
Do this:
Math.floor(Math.random()*1000)
Who knows? Who cares!
Actually Math.floor(Math.random()*1000)
looks much clearer :)
I run into a bug with VK Like widget in IE8. It may initialise Like widget twise If there are more than one Like button on the page because IE8 sometimes somehow can create several DOM elements at the exact same time, thus there are many elements on the page with the same ID. Random number seems to solve the problem.