通过jquery插件 FileSave.js
<script src="__PUBLIC__/Home/js/FileSaver.min.js"></script>引入插件 var blob = new Blob([msg], {type: "text/plain;charset=utf-8"}); //插入内容 saveAs(blob, "1.txt"); //生成下载文件