简体   繁体   中英

How to save textbox data to file using javascript

I have a web page containing a textbox. This textbox shows result of processing. There is a button "Save Result" to save contents of textbox to file. I know it can be easily done with FileStream. But I want the same functionality to save file using Javascript so that there is no need for server postback.

Do anybody have solution to this?

Thanks for sharing your time.

As Darin said JavaScript works on the client's side. As far as I know you won't be able to create files on the user computer using javascript.

A little google-ing mentioned it being posible with JScript/ActiveX/IE (Never tried it).But I would suggest a different approach. Good luck!

您可以使用html5的本地存储将其保存到客户端的文件系统,但只能访问该网站。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM