title: Auto refresh a div HTML/jQuery
body: <p>I try to get a div refreshed with jQuery.</p>
  
  <pre><code>&lt;div class="col-lg-8" id="btc"&gt; Send &lt;?php echo $bitcoin_price; ?&gt;&lt;/div&gt;
  
  &lt;script&gt;
      $(document).ready(function () {
          var interval = setInterval(refresh, 5000);
      });
  
      function refresh() {
          $.get('site', function (result) {
              $('#btc').html(result);
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p><br></p>
  
  <pre><code>$bitcoin_price:
  
  $url = "https://bitpay.com/api/rates";
  
  $json = file_get_contents($url);
  $data = json_decode($json, true);
  
  // $data[1] = USD
  $rate          = $data[1]["rate"];
  $usd_price     = 10;     # Let cost of elephant be 10$
  $bitcoin_price = round($usd_price / $rate, 8);
  </code></pre>
  
  <p>Anyone knows how to to get this div refreshed with an interval and execute the request?</p>
  
  <p>Or is this not possible? Do i need to include and refresh a file with ajax?</p>