about 6 years ago

以下為本次的需求,需要能夠每60秒就執行自動更新頁面

        <script type="text/javascript">
    var autoRefrash = "<%=autoRefrash %>";
    var Refrash_fg;
    $(document).ready(function () {
        $('#addCellRec').click(StopRefrashPage);
        $('#autoRefrash').click(function () {
            //自動刷新頁面

            if (autoRefrash == "1") {
                location.href = 'CellRecordIndex.aspx';
            } else {
                location.href = 'CellRecordIndex.aspx?autoRefrash=1#tail';
            }
        });
        if (autoRefrash == "1") {
                //執行刷新任務,回傳物件可被中斷

            Refrash_fg = self.setInterval("self.location.reload();", 600000);
        }
    })
    function StopRefrashPage() {
            //停止執行

        window.clearInterval(Refrash_fg);
    }
    function RefrashPage() {
        self.location.reload();
        return Refrash_fg;
    }
        </script>
← 關閉skype將電話號碼自動轉為連結 Eclipse Adb 錯誤 →
 
comments powered by Disqus