Last active
          December 1, 2015 06:13 
        
      - 
      
- 
        Save smallnewer/14afabe9d6d603444838 to your computer and use it in GitHub Desktop. 
    download file
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | /** | |
| * 只支持chrome | |
| **/ | |
| function downloadFile (type, filename, filecon) { | |
| filename = prompt('填写保存的名字', filename); | |
| var blob = new Blob([filecon], { type: type }); | |
| var url = window.webkitURL.createObjectURL(blob); | |
| var a = document.createElement("a"); | |
| a.download = filename; | |
| a.href = url; | |
| a.click(); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment