JS 定时器,定时调用PHP

时间:2022-04-09 00:16:26
$(function() {
     var voiceplay=function(){
         var site = location.href.split('_cms')[0] + '_cms/';
         $.ajax({ 
             url: site + 'main_equipment/getMainEquipmentStatus', 
             method:'get', 
             success: function (data) {
                    console.log(data);return;
                }, 
                complete: function (XHR, TS) { 
                    XHR = null;
                } 
            })
        }
        //定时器,定时加载
        setInterval(voiceplay,3000);
    })

关注微信公众号:lovephp

JS 定时器,定时调用PHP