iT邦幫忙

0

[歷程]在JavaScript讀取Session,用Ajax防止Session過期及Server斷線

  • 分享至 

  • xImage
  •  
//取session值
var sessionstatus = "<%=Session['EmailId']%>";
$(function () {

    function post() {
        $.ajax({
            type: "post",
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            url: "",
            complete: function post(sessionstatus) {
                //alert(sessionstatus.status) = 200 ;
                if (sessionstatus.status !== 200) {
                    alert('帳號登入時間已逾時或網路連接有問題,請重新登入');
                    window.location.replace("https://twdrill.com.tw/Account/Login");
                   
                }

            },

        });


    }
    //timer
    setInterval(post, 5000);
   

});

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言