javascript window.setInterval not working on latest Firefox and IE9
<p>i recently created a custom ping box(chat) for personal needs. When i coded it and tested in Firefox 3.6.13, it worked fine. However the functionality related to window.setInterval doesnt seem to work fine in IE9 or Firefox 6.</p>

<p>Below is the code for javascript.</p>

<pre><code>    &lt;script&gt;

     function loadNewPosts(){
        var id = $(".altbgcolor:first").attr("id");

        $.get('/updateping.php', { updateid: id ,  }, function(data){
                                $(".newslist").prepend(data);
                            }, 'html');
     }

     window.setInterval(loadNewPosts, 1000*3)   


     $(document).ready(function() { 
    // bind form using ajaxForm 

             $("#pingForm").validate({


                submitHandler: function(form) {  
                $('#pingForm').ajaxSubmit({ 
                        // target identifies the element(s) to update with the server response 
                        target: '#pingResult', 

                        // success identifies the function to invoke when the server response 
                        // has been received; here we apply a fade-in effect to the new content 
                        success: function() { 

                            $('#msg').val('');
                            $('#pingResult').fadeIn('slow'); 
                            $('#pingResult').fadeOut(2000); 
                        } 
                    });
                }
            }); 

        })


 &lt;/script&gt; 
</code></pre>

<p>Below is the HTML</p>

<pre><code>      &lt;ul class="newslist" style="width:630px;"&gt;

        &lt;li class="altbgcolor" id=64&gt;
    &lt;div&gt;   
        &lt;div class="newsthumb" style="width:50; height:50; "center center no-repeat;"&gt;&lt;img src="images/personal/sunny.jpg" /&gt;&lt;/div&gt;



        &lt;div class="newstext" style="margin:0px;"&gt;


        &lt;h1 style="color:#081C28;"&gt;&lt;img width="11" height="9" src="/content/icon_topic_newest.gif"&gt;how r u?&lt;/h1&gt;

        &lt;/div&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;div style="font-size: 0.6em; color:#666666;"&gt;  
            &lt;span style="text-decoration:none; color:none; padding:5px;"&gt;&lt;i&gt; from: &lt;a href="" style="text-decoration: none;color:#105289 ;" onmouseover="this.style.textDecoration = 'underline'" onmouseout="this.style.textDecoration = 'none'"&gt;Sunny&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;                          
            &lt;span style="text-decoration:none; color:none; padding:5px; "&gt;&lt;i&gt; posted: &lt;a href="" style="text-decoration: none;color:#105289 ;" onmouseover="this.style.textDecoration = 'underline'" onmouseout="this.style.textDecoration = 'none'"&gt;October 29, 2011, 9:58 am&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;                           
        &lt;/div&gt;  

        &lt;div class="clear"&gt;&lt;/div&gt;
     &lt;/div&gt;


    &lt;/li&gt;
        &lt;/ul&gt;
</code></pre>

<p>I tried to debug the problem using Firebug, but though it does seem that window.setInterval is able to call the .php file with required parameters every 3secs, however it doesnt show the o/p of the php file.</p>

<p>Code of php (updateping.php)</p>

<pre><code>        &lt;?

        require_once('includes/connection.php');
        require_once('includes/functions.php');

        if(isset($_GET['updateid']))
        {
            $updateid=$_GET['updateid'];
            $sql="SELECT * FROM ping WHERE id &gt; $updateid ORDER BY id DESC";

            $res=mysql_query($sql,$connection);

            if(@mysql_num_rows($res))
            {
                while($data=mysql_fetch_array($res))
                        //while($data=mysql_fetch_array($result))
                        {
                                echo '&lt;li class="altbgcolor" id='.$data['id'].'&gt;
                                    &lt;div&gt;   
                                        &lt;div class="newsthumb" style="width:50; height:50; center center no-repeat;"&gt;&lt;img src="'.$data['img'].'"  /&gt;&lt;/div&gt;



                                        &lt;div class="newstext" style="margin:0px;"&gt;


                                        &lt;h1 style="color:#081C28;"&gt;&lt;img width="11" height="9" src="/content/icon_topic_newest.gif"&gt;'.stripslashes($data['msg']).'&lt;/h1&gt;

                                        &lt;/div&gt;
                                        &lt;br /&gt;&lt;br /&gt;
                                        &lt;div style="font-size: 0.6em; color:#666666;"&gt;  
                                            &lt;span style="text-decoration:none; color:none; padding:5px;"&gt;&lt;i&gt; from: &lt;a href="" style="text-decoration: none;color:#105289 ;" onmouseover="this.style.textDecoration = \'underline\'" onmouseout="this.style.textDecoration = \'none\'"&gt;'.$data['name'].'&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;                          
                                            &lt;span style="text-decoration:none; color:none; padding:5px; "&gt;&lt;i&gt; posted: &lt;a href="" style="text-decoration: none;color:#105289 ;" onmouseover="this.style.textDecoration = \'underline\'" onmouseout="this.style.textDecoration = \'none\'"&gt;'.$data['entry_date'].'&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;                         
                                        &lt;/div&gt;  
                                        &lt;div class="clear"&gt;&lt;/div&gt;
                                     &lt;/div&gt;


                                    &lt;/li&gt;'; 


                        }


            }

        }




        ?&gt;
</code></pre>

<p>I am in a fix here and dont understand what could be the problem. That chatbox works fine on FF 3.6.13</p>

<p>Please help me someone!!!!!!!!!!!</p>

<p><strong>UPDATE:</strong>
I tried the IE9 'F12' developer debugger and found that every 3 secs thought the php file is called the return result type 304-Not modified. :((</p>

<p>I went to 'Cache' options on the debugger menu and checked the option 'Always Refresh from server' and bammmm!!!! it worked now.</p>

<p>Any idea how to tweak this in actual IE and Firefox settings. The problem seems to be related to caching only.</p>
