自动循环提交js

<script type="text/javascript"> 
       (function poll() { 
        console.log("i work")
        $.ajax({      
         type: 'POST', 
         url: '/api/Home/ChangeOpenId', 
         dataType: "json", 
         timeout: 30000, 
         complete: function (data) { 
            if (data == 'True') {
                console.log("True")
            } else{
                console.log("False")
                poll()
            }
         }, 
        }); 
       })(); 
     </script> 

 

posted @ 2023-12-04 08:16  shiningrise  阅读(25)  评论(0编辑  收藏  举报