赞
踩
上代码:
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Download Text File Demo</title>
- <style>
- body{ font: menu; }
- </style>
- <script src='download.js'></script>
- </head>
- <body>
- <h1>Download Text File Demo</h1>
- <main></main>
- <script>
- download("我是麦兜", "text.txt", "text/plain");
- </script>
- </body>
-
- </html>

创建了
text.txt 文件, 文件的内容为 我是麦兜
我在我的上一个文章里面也写了一个js下载的方法,这个不行请参考另一个
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。