Multiple instances on one page with Javascript
<p>I'm having trouble figuring out how to handle multiple instances of some javascript functions that I want to run on a page. It's part of a custom analytics project that I'm working on.</p>

<p>I have a function called initData(); The function uses a setInterval to call another function that sends a ping to my server every 1000ms. </p>

<p>The problem is that I want to be able to have more than one instance of this function on a single page. My current problem is that as soon as the second instance is called it overwrites all the variables from the first.</p>

<p>What's the best way to get around this? Is there a way to make the functions seperate and/or private instances so that they don't interfere with each other?</p>
