Auto-refresh iFrame help

Discussion in 'Community Help Center' started by G4HPE, Mar 20, 2016.

Tags:
ad: L-HROutlet
ad: l-rl
ad: abrind-2
ad: L-MFJ
ad: Subscribe
ad: Left-3
ad: Left-2
  1. G4HPE

    G4HPE Ham Member QRZ Page

    I have recently added an iFrame to my personal page. The web page to which this points updates regularly. Is it possible to get the iFrame on QRZ to refresh automatically? I'm afraid I have very little knowledge of HTML! The iFrame line in the source code is:

    <p style="text-align: center;"><iframe frameborder="0" height="300" name="WAB ARRIVALS BOARD" scrolling="no" src="https://docs.google.com/spreadsheet...nHh7jw/pubhtml?gid=1093492114&amp;single=true" width="1000">Loading...</iframe></p>
     
  2. KA9JLM

    KA9JLM Ham Member QRZ Page

    Try this.

    <head>
    <meta http-equiv="refresh" content="30">
    </head>

    To refresh every 30 seconds.

    300 would be every 5 minutes.

    Good Luck.
     
    Last edited: Mar 20, 2016
    N6QIC likes this.
  3. G4HPE

    G4HPE Ham Member QRZ Page

    Hi Don,

    I really appreciate your quick response, thank you!
    The HTML you suggest certainly works on the whole page.
    I was hoping to only refresh the specific iFrame as the rest of the page is static, the drawback being that when refreshing the whole page it jumps the viewer back up to the top away from the iFrame of interest.
    Nevertheless, this helps me to progress so much appreciated.
    73 de Steve G4HPE
     
  4. KA9JLM

    KA9JLM Ham Member QRZ Page

    <!DOCTYPE html><html><head><meta http-equiv="refresh" content="300"><title>WAB REPORTER</title><meta name="viewport" content="target-densitydpi=device-dpi,user-scalable=1,minimum-scale=1,maximum-scale=2.5,initial-scale=1,width=device-width">

    Putting the code there should only refresh that frame.

    Some browsers do jump to the top if the whole page reloads.

    Good Luck. You will get it. :)
     
  5. KA9JLM

    KA9JLM Ham Member QRZ Page

    Well I screwed up on my last post. Sorry about that.

    This may be the best way.

    <script>
    window.setInterval("reloadIFrame();", 300000);

    function reloadIFrame()
    {
    document.frames["WAB ARRIVALS BOARD"].location.reload();
    }
    </script>

    The time is in milliseconds

    Good Luck.
     
    N6QIC likes this.
  6. N6QIC

    N6QIC Premium Subscriber QRZ Page

    In your Bio you can link any text or picture to a URL. I would add the link this way instead of embedding the code in your page. Then when they click on it, it is already updated.
     

Share This Page