ajax调用在Internet Explorer中花费了很多时间

时间:2017-02-08 09:42:48

标签: jquery ajax model-view-controller

以下jQuery帖子在Internet Explorer中占用了大量时间,但在Chrome中却没有。该方法在其他页面中立即生效。这种方法对所有页面都是通用的。

function checkSession() {
  debugger;
  var checkSessiontUrl = '@Url.Action("CheckSession", "Home", null, Request.Url.Scheme)';
  var logoutUrl = '@Url.Action("LogOut", "Home", null , Request.Url.Scheme)';
  noProgressLoaderRequired = true;
  $.ajax({
    url: checkSessiontUrl,
    data: {
      uniqueId: '@Session["UniqueId"]'
    },
    type: "POST",
    cache: false,
    dataType: 'json',
    success: function(data) {
      if (data != true) {
        debugger;
        isInsideApplication = true;
        window.location.href = logoutUrl;
      }
      noProgressLoaderRequired = false;
    },
    error: function(xhr, ajaxOptions, thrownError) {
      //alert('Ajax failure');
      isInsideApplication = true;
      window.location.href = logoutUrl;
      noProgressLoaderRequired = false;
    }
  });
}

0 个答案:

没有答案