jQuery Initial Function Call Not Working
<p>I am updating divisions through an Ajax call that has a set interval; which works and updates correctly including when it is accessed from another click event, except for the standalone first call made before the interval is set.</p>

<p>The call (does not update):</p>

<pre><code>$(document).ready(function(){
var c = 0;
$(".content").load('coreprocessing.php',function(){
    $(".content").fadeIn(400,function(){
        refreshIt();
    });
});
</code></pre>

<p>with refresh set:</p>

<pre><code>var refreshId = setInterval(refreshIt,60000);
</code></pre>

<p>immediately following the load call.</p>

<p>Function:</p>

<pre><code>function refreshIt(){
    var page = $(".navselected").attr('id');
    var ids = $('.content div[id]').map(function(){
        return this.id;
    }).get();
    $.ajax({
        type:'POST',
        url:page + 'functions.php',
        data:{'idList[]':ids},
        dataType:'json',
        success:function(data){
            $.each(data,function(element,load){
                var elem = $("#" + element);
                elem.slideUp(400,function(){
                    elem.removeClass("critical ok").addClass(load.status).html(load.number).slideDown(400);
                    if(load.status == 'critical'){ c++;}
                });
            });
        updateInfoBar(c);
        if(page == 'coreprocessing'){ updatePumpDataBar() }
        c = 0;
        }
    });
}
</code></pre>

<p>When I "alert(c)", it pops up when load.status is critical (as intended), however it insists on returning 0 the first time. Any assistance would be greatly appreciated. I have played around with scope but can't seem to figure this one out.</p>

<p>-Justin</p>
