//通过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 });

05-11 17:25