jQuery的Ajax调用返回403状态

jQuery的Ajax调用返回403状态

问题描述:

我有一个jquery Ajax调用实施了存活的会议,这KEEPALIVE()方法将每20分钟在调用

I have a jquery Ajax call implemented for keepalive the session, this keepAlive() method will call in every 20 mins

    function keepAlive() {
        $.ajax({ type: "POST",
            url: "KeepAliveDummy.aspx", cache: false
        });
    }

此调用发生时,第三方内容的框架装载,

This call is happen when the third party contents are loaded in to the frameset,

我对这个要求得到403 HTTP状态(通过提琴手检查), 这是否会影响最终的结果刷新会话超时?

I'm getting 403 http status (check via fiddler) on this request, Will this impact the end result of refresh the session time out?

由于您的问题是有关处理403错误(这会不会影响刷新会话超时的最终结果?),而什么403。

Since your question is about handling 403 error (Will this impact the end result of refresh the session time out?) rather what 403 is.

因此​​,处理此错误,您可以登录或通知。

So, handle this error, you can log or notify.

  $.ajax({
      type: "POST",
      url: "KeepAliveDummy.aspx",
      success: function (response) {
          //session refreshed
      },
      error: function (xhr, ajaxOptions, thrownError) {
        if(xhr.status==403) {
            //handle error
        }
      }
    });