js 截流

var  isEnable=true;
form.on('submit(search)', function(data){
        if(!isEnable){
          return;
         }
        isEnable=false;
       setTimeout(function(){
         console.log("函數節流測試");
         isEnable = true;
        }, 2000);
    table.reload('test', {
        url: "{:url('al/cs/search')}"
        ,method:'post'
        ,where: {
            'dateline':$("#date").val()
        }
    });
    return 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章