how do you set interval to ajax call in jquery [closed]

I need to create an ajax call every 5 minutes. I have to below code. Can someone tell me how would I modify this code to run that ajax every 5 minutes?

    $(document).ready(function() {
     var seriesOptions = [],
        yAxisOptions = [],
        colors = Highcharts.getOptions().colors;

                    url: 'echo_file.php', 
                    datatype: 'json',
                    success: function(data) {


                    cache: false    

       function createChart() {



At the simplest level, put your AJAX call into a function, then create an interval:

setInterval(ajaxCall, 300000); //300000 MS == 5 minutes

function ajaxCall() {
    //do your AJAX stuff here


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.