码迷,mamicode.com
首页 > Web开发 > 详细

html 定时执行

时间:2017-10-09 19:43:37      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:doc   post   返回   oca   ajax   pos   index   har   window   

 

 

 

    <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>

  

html 定时执行

标签:doc   post   返回   oca   ajax   pos   index   har   window   

原文地址:http://www.cnblogs.com/lhlong/p/7642328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!