How to save and edit a file using JavaScript?

后端 未结 5 1661
悲&欢浪女
悲&欢浪女 2020-12-06 02:44

I want a user of my website to enter some text in a text area and when he submits the form, the text that he entered be stored in a .txt file that is present in same directo

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 02:44

    This one might help you.

    http://wcetdesigns.com/tutorials/2012/11/01/edit-save-file.html
    https://web.archive.org/web/20131210151034/http://wcetdesigns.com/tutorials/2012/11/01/edit-save-file.html

    edit.php, file where users can edit using the textarea tag.
    
    
    
    
    
    
    



    view file save.php, file where the saving process will take place.

    Javascript doesn't have access to file system so you must use some server side language like PHP as in the given example

提交回复
热议问题