jquery - How to Refresh A named divison and not the entire page? -


i can't seem right. helped me before told me use jquery , have tried , cannot work. trying automatically refresh division on html page made , not entire page.

i tried meta refresh entre page. everywhere search has similar answer cannot work. division trying refresh called "frame" need refresh every 45 minutes.

<html>      <head>          <title>station 47</title>      </head>        <body bgcolor="darkred">          <body link="black" vlink="black">          <center><font face="times new roman" size="6"><marquee behavior="scroll" direction="left">naval district washington fire department station 47</marquee>      </body>        <table border="0">          <tr>              <td>                  <p align="left">                  <iframe id="iframe1" src="https://webview.active911.com/client/" frameborder="0" scrolling="no" width="2360" height="930"></iframe>              </td>          </tr>            <tr>              <td>                  <div>                      <iframe id="iframe2" src="http://www.chart.state.md.us/video/video.php?feed=7401e25800f700d700437a45351f0214" width="400" height="400" frameborder="0" scrolling="no"></iframe>                      <iframe id="iframe3" src="http://www.chart.state.md.us/video/video.php?feed=7e01ec5800f700d700437a45351f0214" width="400" height="400" frameborder="0" scrolling="no"></iframe>                      <iframe id="iframe4" src="http://www.chart.state.md.us/video/video.php?feed=7901e75800f700d700437a45351f0214" width="400" height="400" frameborder="0" scrolling="no"></iframe>                      <iframe id="iframe5" src="http://www.chart.state.md.us/video/video.php?feed=6100bdd12e83001c00503336c4235c0a" width="400" height="400" frameborder="0" scrolling="no"></iframe>                      <iframe id="iframe6" src="http://www.chart.state.md.us/video/video.php?feed=4900c5b02e84001c00503336c4235c0a" width="400" height="400" frameborder="0" scrolling="no"></iframe>                       <iframe id="iframe7" src="http://api.wunderground.com/api/5ce4445b4bd79f9a/animatedradar/q/md/annapolis.gif?&width=415&height=415&newmaps=1&timelabel=1&timelabel.y=10&num=15&delay=50" width="338" height="400" frameborder="0" scrolling="no"></iframe></td>                  </div>              </td>          </tr>      </table>  </html>

given html code correct, here can do:

  1. include jquery (add following in head or @ bottom of page, before body closing tag):

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
  2. using jquery, write function able iframes:

    function reloadframes(){    $(".frames iframe").each(function(i, iframe){       iframe.contentdocument.location.reload(true);    }); } 
  3. call function every 45 minutes. that, can use setinterval. first parameter function call, second 1 frequency, in ms:

    setinterval(reloadframes, 45*60*1000); 

so recap, can paste following @ end of body:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script type="text/javascript">     $(function() {        setinterval(reloadframes, 1000);        function reloadframes() {         console.log("reloading iframes")         $(".frames iframe").each(function(i, iframe) {           iframe.contentdocument.location.reload(true);         });       }      }); </script> 

Comments