why does this code not set document title dynamically?
<p>I am trying to dynamically update the document title from php script in regular intervals, it seems to not be working. I am a beginner to jquery, please help.</p>

<pre><code> &lt;div id="code" style="border: 1px solid; "&gt;&lt;/div&gt;
    &lt;script&gt;
     var blink = true;

    setInterval(function(){

    if(blink){
    jQuery('#code').load('test.php', function(result) {
    var theTitle = document.getElementsByTagName("title")[0];   
         theTitle= 'google'+jQuery('#code').html();

    });

        //theTitle.text =document.getElementById('code').value;
        blink = false;
    }else{

     jQuery('#code').load('test.php', function(result) {
    var theTitle = document.getElementsByTagName("title")[0];   
         theTitle= 'yahoo'+jQuery('#code').html();

    });

        blink = true;
    }
    }, 2000);
</code></pre>
