How to cache/precalculate something(without global variable)?
<p>What I want to do is to sending data between two handlers.</p>

<pre><code>element.onmousedown = function() {
    data = precalculate();
}

element.onmouseup = function() {
    dosomething(data);
}
</code></pre>

<p>if the <code>data</code> is a global variable it works. People says global variable is evil. But I don't know how to do without it.</p>

<p>or I misunderstood "global variable"?</p>
