title: How to refresh only <div> content in a web page?
body: <p>The div is:</p>
  
  <pre><code>&lt;div&gt;
          &lt;canvas id="chart-area2" width="300" height="300"/&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>how to refresh the above div every 10 seconds without reloading the page? </p>
  
  <p>following is the javascript:</p>
  
  <pre><code>&lt;script&gt;
  
      var pieData2 = [
              {
                  value: &lt;?= $pfstatetext;?&gt;,
                  color:"#F7464A",
                  highlight: "#FF5A5E",
                  label: "Red :"
              },
              {
                  value: &lt;?= $cpuusage; ?&gt;,
                  color: "#46BFBD",
                  highlight: "#5AD3D1",
                  label: "Green"
              },
              {
                  value: 100,
                  color: "#FDB45C",
                  highlight: "#FFC870",
                  label: "Yellow"
              },
              {
                  value: 40,
                  color: "#949FB1",
                  highlight: "#A8B3C5",
                  label: "Grey"
              },
              {
                  value: 120,
                  color: "#4D5360",
                  highlight: "#616774",
                  label: "Dark Grey"
              }
  
          ];
  
          window.onload = function(){
  
              var ctx2 = document.getElementById("chart-area2").getContext("2d");
              var myPie2 = new Chart(ctx2).Pie(pieData2);
  
          };
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>how can i use setInterval in the above code?.....................................................................................................</p>