html 定时执行

 

 

 

    <script>
        $(function () {

            //默认是发货追溯(供应商)页面
            document.getElementById('ViewBackSupp').click();

            //判断登录是否过期
            setInterval(GetIsHaveOverTime, 5000);
        });


        function GetIsHaveOverTime() {
            
           
            $.ajax({
                type: "post",
                dataType: "json",
                url: '/Home/GetIsHaveOverTime', //回发到的页面   
                
                success: function (data) {
                    //0 未过期  1 已过期 ,过期则返回登录界面
                     
                    if (data.result == 1) { 

                        window.location.href = '/Login/Index';
                    }
                    
                }
            })

            
        }

    </script>

  

posted @ 2017-10-09 18:12  人生为卒  阅读(345)  评论(0编辑  收藏  举报