Release Ajax-based general website draft automatic saving system sipoautosaver (V1.0)
[Download] sipoautosaver V2.0 automatic saving system for general website drafts
Preface:
The reason for making this small program is that when I wrote logs two days ago, I accidentally pressed the webpage navigation key on the IBM laptop keyboard, leading to the loss of articles. Does anyone know how to disable these two keys? (Non-physical method... not counting with tape, I have tried a lot ...)
If you have used Gmail, the most attractive thing about Gmail is its automatic draft saving function.
I don't know if someone has developed such a simple and useful applet. I did not find any related keywords on the Internet. I simply edited one by myself, so that people who needed it could find it after two days.
Instructions for use:
1. the compressed package contains three files.
Test.htm test demo file (must be uploaded to the server for use, the local file is invalid)
The main program sipoautosaver. JS is placed in the same directory as the form to be automatically saved.
The sipoautosaver. asp main program is placed in the same directory as the form to be automatically saved.
2. Open sipoautosaver. js
(1) Modify var url = "http: // 127.0.0.1/sipoautosaver. asp ";
Change 127.0.0.1 to your own website path.
(2) Modify var poststr = Document. formname. textareaname. value;
Change FormName to the name (name attribute value) of your Form, and change TextAreaName to the name of the text box (name attribute value) You want to save)
(3) var AutoSaveTime = 60; indicates automatic saving in 60 seconds.
3. Open SipoAutoSaver. asp.
Modify const FileName = "AutoSave.txt"
Modify autosave.txt to save the file name. You don't need to worry about him anymore.
4. Add the following code to the text box of the form to be automatically saved: (127.0.0.1 must use your own website path)
<Span id = "timemsg"> </span>
<Span id = "msg"> </span>
<Script language = "JavaScript" src = "http: // 127.0.0.1/SipoAutoSaver. js"> </SCRIPT>
Call example: Test.htm
<Form name = "FormName">
<Textarea id = "TextAreaName" ROWS = "" COLS = ""> dc9.cn </TEXTAREA>
<Input type = "button" value = "save now" onClick = "savedraft ();">
</Form>
<Span id = "timemsg"> </span>
<Span id = "msg"> </span>
<Script language = "JavaScript" src = "http: // 127.0.0.1/SipoAutoSaver. js"> </SCRIPT>
The test result of Test.htm is as follows:
For example, how to apply it in Z-Blog
1. modify document. FormName. TextAreaName. value in SipoAutoSaver. js.
Is document. edit. txaContent. value
Change the url to your own blog address. Upload to the blog root directory
2. Open edit. asp.
Insert after <% = zc_ms000055 %>:
<Span id = "timemsg"> </span> <span id = "msg"> </span>
<Script language = "JavaScript" src = "SipoAutoSaver. js"> </SCRIPT>
That's all.
The test result of Z-Blog is as follows:
Solution to garbled code:
If the generated txt file is garbled, you can change the browser encoding to UTF-8. download it to your local file and use notepad.
Download
Just released SipoAutoSaverV3.0 (click to enter)
Http://www.dc9.cn/post/SipoAutoSaverV3.html
This article contains attachments |
File Name: |
SipoAutoSaverV1.rar |
File Type: |
Rar |
File Size: |
2.24KB |
Downloads: |
142 |
Introduction |
Version 1.0 |
Download Now |
Just released SipoAutoSaverV3.0 (click to enter)
Http://www.dc9.cn/post/SipoAutoSaverV3.html (tags: sipoautosaver)