How refresh automatically iframe every 5 minutes ?

  • 3lpum4
    Asked on April 3, 2018 at 8:09 PM

    In this post talk who refresh automatically iframe one time.


     https://eu.jotform.com/answers/533021-Automatically-refreshing-the-web-page-once-only

    I collected these options but only refresh one time.

    <script type="text/javascript">

    if(location.search.indexOf('r') < 0){

        var hash = window.location.hash;

        var loc = window.location.href.replace(hash, '');

        loc += (loc.indexOf('?') < 0? '?' : '&') + 'r';

        setTimeout(function(){window.location.href = loc + hash;}, 2000);

    }

    </script>

     

    AND

     

    <script language=" JavaScript" ><!--

    function MyReload()

    {

    window.location.reload();

    }

    //--></script>

     

    <Body onDISABLEDload=" MyReload()" > 

     

     

    AND

     

     

    <script type="text/javascript">    

        setInterval(page_refresh, 5*60000); //NOTE: period is passed in milliseconds

    </script>

     

     

    https://stackoverflow.com/questions/6160415/reload-an-html-page-just-once-using-javascript

     

    https://eu.jotform.com/answers/533021-Automatically-refreshing-the-web-page-once-only

     

     

    AND

     

     

    <script type="text/javascript" src="https://form.jotformeu.com/80846493433362"></script>

     

    <script>

     

    function reloadIt() {

        if (window.location.href.substr(-2) !== "?r") {

            window.location = window.location.href + "?r";

        }

    }

     

    setTimeout('reloadIt()', 2000)();

     

    </script>

     

  • tina JotForm Developer
    Replied on April 4, 2018 at 2:29 AM

    I am not sure if I understood your question sufficiently. Could you please explain your question a bit more so we can assist you better?

  • 3lpum4
    Replied on April 4, 2018 at 2:36 AM

    Sorry Tina,

    I was mistaken when wrinting the tittle of the post.

    I mean: "How refresh automatically one iframe every x time ? "

    I have one iframe to connected with a google spreedsheet. This spreadsheet is update every x time. I need the iframe could be updated to see the data correctly at least every 3-5 minutes.

     

    Thanks

  • 3lpum4
    Replied on April 4, 2018 at 2:48 PM

    UP !

  • TREVON
    Replied on April 4, 2018 at 4:04 PM

    I have one iframe to connected with a google spreedsheet. This spreadsheet is update every x time. I need the iframe could be updated to see the data correctly at least every 3-5 minutes.

    Kindly note that we only provide iframe which you can link with your website scripts to achieve what you intend to. The other scripting code I would recommend Javascript is basically not covered in Jotform.

    I will however share a Javascript code that may work for you but you will need to customize it to suite your needs.

     

    Here is another function you can use to reload your page every 5 minutes

    $(document).ready(function() {

    setInterval(function() { cache_clear() }, 30000); });function cache_clear() { window.location.reload(true); // window.location.reload(); use this if you do not remove cache }