将内容转化为文件下载


通过jquery插件  FileSave.js 

引入插件

 var blob = new Blob([msg], {type: "text/plain;charset=utf-8"}); //插入内容
saveAs(blob, "1.txt");  //生成下载文件