I want to manage refresh page interval from front end. Jquery

Viewed 31

I have a auto div refresh script which is made with jQuery. In this script have interval function also. I need to manage this interval from front end of page. Eg: <input type="text" placeholder="Set your refresh timing">

setInterval(function() { $("#div_refresh").load("load.php"); }, 1000); });.

Here 1000 = 1 second. Users are managing this interval from front end from So users can set refresh interval as their wish. Please help..

$("#div_refresh").load("load.php");
        }, 1000)

Users are setting the refresh timing from front end in the input.<input type="text"> Eg: https://prnt.sc/irq0dPMaSXPJ

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <div id="div_refresh"></div>
    <script type="text/javascript">
     $(document).ready(function(){
        $("#div_refresh").load("load.php");
        setInterval(function() {
            $("#div_refresh").load("load.php");
        }, 1000);
    });
    </script>
0 Answers
Related