我可以保存文本文件吗? [英] Can I save a text file?

查看:73
本文介绍了我可以保存文本文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的JavaScript应用程序,它将为最终用户生成一些文本类型

数据。是否可以有一个按钮,允许他们将这些信息保存到文本文件中?


Thomas

I have a simple JavaScript application that will generate some text type
data for the end user. Is it possible to have a button that will allow them
to save this information to a text file?

Thomas

推荐答案

Thomas Magma于2006年3月31日在comp.lang.javascript写了
Thomas Magma wrote on 31 mrt 2006 in comp.lang.javascript:
我有一个简单的JavaScript应用程序将为最终用户生成一些文本类型数据。是否可以有一个按钮,允许他们将这些信息保存到文本文件中?
I have a simple JavaScript application that will generate some text
type data for the end user. Is it possible to have a button that will
allow them to save this information to a text file?




不具有正常安全设置的客户端。

客户端的硬盘是遥不可及的,应该是这样的。


-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)



Not clientside with normal security settings.
The client''s hard-disk is out of reach, and should be so.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


>
没有正常安全设置的客户端。
客户端的硬盘是遥不可及的,应该是这样。

- Evertjan。
荷兰。
(请将x''es更改为我的电子邮件地址中的点数)
Not clientside with normal security settings.
The client''s hard-disk is out of reach, and should be so.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)




我同意让网页能够阅读或写入硬盘

将是一场安全噩梦。我只是想知道最好的方法来获得
,允许最终用户保存由JavaScript处理的信息。

除了拍摄他的显示器的照片。我想一个选项是将信息写入一个大文本框中,最终用户可以简单地复制这个信息,然后将b $ b粘贴到他自己的文本文件中。任何人都知道保存

文本数据的其他方法吗?


Thomas



I agree that giving webpages the ability to read or write to the harddrive
would be a security nightmare. I''m just wondering on the best approach to
allowing a end user the ability to save information processed by JavaScript.
Aside from taking a picture of his monitor. I guess one option is to write
the information to a large text box where an end user can simply copy and
paste it to his own text file. Anyone know of any other methods of saving
text data?

Thomas


Thomas Magma于2006年3月31日在comp.lang.javascript中写道
Thomas Magma wrote on 31 mrt 2006 in comp.lang.javascript:

不是客户端正常安全设置。
客户端的硬盘是遥不可及的,应该是这样。

- Evertjan。
荷兰。
(请将x''es更改为我的电子邮件地址中的点数)

Not clientside with normal security settings.
The client''s hard-disk is out of reach, and should be so.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)



我同意让网页能够读取或写入
硬盘驱动器是安全的恶梦。我只是想知道允许最终用户保存由JavaScript处理的信息的最佳方法。除了拍他的显示器的照片。我猜测一个选项是将信息写入一个大文本框,最终用户可以将其复制并粘贴到自己的文本文件中。任何人都知道保存文本数据的其他方法吗?



I agree that giving webpages the ability to read or write to the
harddrive would be a security nightmare. I''m just wondering on the
best approach to allowing a end user the ability to save information
processed by JavaScript. Aside from taking a picture of his monitor. I
guess one option is to write the information to a large text box where
an end user can simply copy and paste it to his own text file. Anyone
know of any other methods of saving text data?




Javascript可以填充剪贴板,

所以用户只有将其粘贴到编辑器或MS-Word中,然后保存。


< textarea id =''keep''>要复制的文本< / textarea>


函数copyer(){

var keep = document.getElementById(''keep'')

var myObj = keep.createTextRange( );

myObj.execCommand(" Copy");

}


未经测试。 IE只是我想。


-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数。



Javascript can fill the clipboard,
so the user only has to paste it in an editor or MS-Word, and save that.

<textarea id=''keep''>Text to be copied</textarea>

function copyer(){
var keep = document.getElementById(''keep'')
var myObj = keep.createTextRange();
myObj.execCommand("Copy");
}

Not tested. IE only I think.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于我可以保存文本文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆