ie浏览器下载文件遮挡等待

原创
2019/11/23 15:43
阅读数 159

function download2(id){
    $.jBox.tip("正在下载,请稍后...",'loading',{opacity:0.5,persistent:true});
    var url = '${ctx}/bus/getFile?fileId='+id;
    var iframe = document.getElementById("download_");
    if (null == iframe) {
        alert('没有iframe');
    }
    iframe.src = url;
    checkReadyState();
}
function checkReadyState() {
    var iframe = document.getElementById("download_");
    var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
    if (iframeDoc.readyState == 'complete' || iframeDoc.readyState == 'interactive') {
        $.jBox.closeTip();
        return;
    } else {
        //继续监测
        setTimeout(checkReadyState, 1000);
    }
}

<iframe id="download_" style="display: none"></iframe>

仅支持ie

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部