weixin_33691598 2018-06-27 17:03 采纳率: 0%
浏览 160

返回HTTP 302的Ajax调用

When we make this ajax call, intermittently I get HTTP status code as 302. While most of the times, the ajax call is successful as well returning HTTP status as 200 OK. I am unable to get the exact reason for this and how to overcome this scenario. The HTTP status 302 is returned in particular scenario when I leave the application idle for 10-15 minutes and then make this call. However when I hit the URL directly in browser the correct data is returned. Please advice.

function checkProgressStatus(event){            
     $.ajax({
             url: "/"+window.AppContext+"/servlet/Progress",
             cache: false,
             dataType: 'json',
             async:false,
             success: function(data,ev){ 
                 if(data.Progress == 'INPROGRESS'){                     
                    alert("Execution in progress");
                    event.stopImmediatePropagation();                       
                 }

             },
        error: function (exception) {
            alert("Request to check inprogress status failed.");
            window.open("/"+window.AppContext+"/path/filter/AnotherPage.html");
        }
     });
 } 
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Coze智能助手搭建过程中的问题请教
    • ¥15 12864只亮屏 不显示汉字
    • ¥20 三极管1000倍放大电路
    • ¥15 vscode报错如何解决
    • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
    • ¥15 python随机森林对两个excel表格读取,shap报错
    • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
    • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
    • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
    • ¥15 VFP如何使用阿里TTS实现文字转语音?