Created
July 1, 2014 02:24
-
-
Save wangwen1220/77cbe44f002d988b664a to your computer and use it in GitHub Desktop.
js 下载文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// js 下载文件 | |
function downloadFile(url) { | |
if (typeof(downloadFile.iframe) == 'undefined') { | |
downloadFile.iframe = document.createElement('iframe'); | |
document.body.appendChild(downloadFile.iframe); | |
} | |
downloadFile.iframe.src = url; | |
downloadFile.iframe.style.display = 'none'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment