首页 > 其他 > 详细

通过ifrmae异步下载文档

时间:2017-05-17 13:25:17      阅读:278      评论:0      收藏:0      [点我收藏+]
//通过ifrmae异步下载文档
function iframeGetFile(opts) {
    var defaultOpts = {
        filePath: ‘‘,
        onload: function (e) { }
    }, iframeFile;
    $.extend(defaultOpts, opts);
    iframeFile = document.createElement("iframe");
    iframeFile.onload = function (e) {
        defaultOpts.onload.call(this, e);
        $(iframeFile).remove();
    }
    iframeFile.src = defaultOpts.filePath;
    iframeFile.style.cssText = "display:none;";
    document.body.appendChild(iframeFile);
},

调用:

$.iframeGetFile({ filePath: requestUrl + "?" + strOptions });

通过ifrmae异步下载文档

原文:http://www.cnblogs.com/oufeng/p/6866905.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!