stats is not defined
<p>This code load the content of the php file with the parameter: online and name and print them  dynamic every 0.2s, the whole  code works, but it says that " stats " is not defined in internet explore, i dont know why. Help me out guys</p>

<pre><code>function updateStats(stat)
{
    var stat = ["online","name"];


   var stats = "";


 if (stat==undefined)
{
document.write("is undefined");
}
    var url = "online.php";

    $.each(stat, function(i, key){
       $.post(url, {stats: key}, function(data) { 
          $("#" + key).html(data);       
       });
    });
} 

setInterval('updateStats("updateStats")', 200); //  200 milliseconds = 0.2 seconds
</code></pre>

<p><strong>this is the updated code, but still says that stats not defined</strong> </p>

<pre><code>function updateStats(stat)
{


var stat = ["online","money"];


if (typeof stat == "undefined")
{
document.write("stat is undefined");
}
    var url = "online.php";

    $.each(stat, function(i, key){
       $.post(url, {stats: key}, function(data) { // stats to stat
          $("#" + key).html(data);       
       });
    });
} 


setInterval(function(){
  updateStats("updateStats");
}, 1000);


if (typeof stats == "undefined")
{
document.write("stats is undefined");
}
</code></pre>
