JavaScript / jQuery  why doesn't this work?
<pre><code>function checkSession(){
    $.ajax({url: "session.php", success: function(data){
         if( data == 1){
             var postFilen = 'msg.php';
             $.post(postFilen, function(data){
                 $("#msg").html(data).find("#message2").fadeIn("slow")
            }
         } else {
             $('#message2').hide();
         }
    }});
// setInterval('checkSession()',1000);
}
</code></pre>

<p>Basically, this is checking if data is 1 in session.php, and if it is, it should run msg.php´s div #message2 in #msg</p>
