JSP中如何将textarea的内容另存为一个txt文件

JSP中如何将textarea的内容另存为一个txt文件,第1张

JSP中将textarea的内容另存为一个txt文件方法如下:

<HTML>

<HEAD>

<META content="text/htmlcharset=gb2312" http-equiv="卖大Content-Type">

</head>

<body>

<script type="text/javascript">

function saveas()

{

var winSave = window.open()

winSave.document.open ("text/html","utf-8")

winSave.document.write (document.getElementById("dataarea").value)

winSave.document.execCommand ('SaveAs',true,'test.txt','中态竖.txt')

winSave.close()

}

<闭中/script>

<textarea id="dataarea">

Test, just a test

</textarea>

<input type=button value="另存为" onclick="saveas()">

</body>

</html>

word,复制文本,编辑-选择性粘贴,那里面提供了两种粘贴为图片格式的选择,选择含慧一种确定后,你就有了一个包含文本的图片了,现在你可以把这拦瞎个图片用图片编辑软件简单的简老空整理一下,另存为就好了。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/12285793.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存