Passing function response (callback) as variable to another function
<p>See below. I'm trying to pass <code>function(response)</code> as a variable to be used in a progress bar function. That's the idea anyways. How do I call back the <code>data = response</code> to the <code>var i = data</code> in this case?</p>

<pre><code>$(document).ready(function () {
    $.ajaxSetup({
        cache: false
    });
    var data = 0;
    setInterval(function () {
        $('#divToRefresh').load('usercounter.php', function (response) {
            data = response;
        });
    }, 100);
    window.onload = function () {
        var Animator = new function () {
                var parent = document.getElementById('container');
                var element = document.getElementById('test');
                var target = document.getElementById('message');
                this.move = function () {
                    var i = data;
                    var width = 0;
                    var timer = window.setTimeout(function () {
                        i += 1;
                        element.style.width = width + i + 'px';
                    }, 10);
                };
            };
        Animator.move();
    };
});
</code></pre>
