Refresh JavaScript section only?
<p>I have a section of JavaScript that displays the current temperature, but it does not update as the temperature changes. Is there a way to have that section of JavaScript update on a timer?</p>

<p>EDIT: Sorry, here's the code (not created by me).</p>

<pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
// javascript will go here
$(function(){

// Specify the ZIP/location code and units (f or c)
var loc = '10001'; // or e.g. SPXX0050
var u = 'f';

var query = "SELECT item.condition FROM weather.forecast WHERE location='" + loc + "' AND u='" + u + "'";
var cacheBuster = Math.floor((new Date().getTime()) / 1200 / 1000);
var url = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent(query) + '&amp;format=json&amp;_nocache=' + cacheBuster;

window['wxCallback'] = function(data) {
    var info = data.query.results.channel.item.condition;
    $('#wxIcon').css({
        backgroundPosition: '-' + (61 * info.code) + 'px 0'
    }).attr({
        title: info.text
    });
    $('#wxIcon2').append('&lt;img src="http://l.yimg.com/a/i/us/we/52/' + info.code + '.gif" width="40" height="40" title="' + info.text + '" /&gt;');
    $('#wxTemp').html(info.temp + '&amp;deg;' + (u.toUpperCase()));
};

$.ajax({
    url: url,
    dataType: 'jsonp',
    cache: true,
    jsonpCallback: 'wxCallback'
});
});
&lt;/script&gt;
</code></pre>
