One of the more-interesting features of JavaScript in years gone by, was the in-browser HTML editor named ‘TinyMCE’. What this scriptlet does, is run on the browser, and allow people to edit the contents of a <textarea>, in WYSIWYG style, for submission to an arbitrary Web-application.
For me, this piece of JavaScript has little use. Other Web-applications of mine, already give me HTML editing which is rich enough, not to depend on TinyMCE. But there has been a facet of this scriptlet, which has irked beginning-users and Web-designers so far, which is that by default, it offers no ‘Save’ Menu-entry. The reason it does not is twofold:
- TinyMCE is meant to be integrated into some more-complex Web-page, where its input is also given a defined purpose, and
- By itself, this scriptlet just runs on the browser, from where it has no privilege to store its edited contents anywhere, neither on the server, nor on the client-machine running the browser.
And so some people have wondered, how they could exploit this amazing technology, just to save the edited HTML locally, to the hard-drive of the computer running the browser. And there are many possible ways to solve that problem, out of which I’ve just implemented one:
It’s possible to add a ‘Submit’ button, which sends the edited content to the server, which can in turn display it as a Web-page, that the user can save to his hard drive, using the “Save Page As…” Menu-command belonging to his browser. I cannot think of a solution that would be easier. However, if somebody wanted to use this mechanism, then next, he’d also need to open the .HTML-File saved to his hard-drive, and edit out the parts of it, that make it a Web-page, thus editing the saved HTML-File down to just the part that displays between the <body>…</body> tags.
https://dirkmittler.homeip.net/tinymce/plugin/tinymce
Enjoy.
(Update 2018/08/13 : )
Because this example of JavaScript sends the text to my server, which echos it back to the browser, I suppose that in theory I could reprogram my CGI-script, to keep a complete record of all the text-fragments submitted. But in practice, I see no point in doing so, and therefore also keep no record of what has been typed.
In addition, because I’ve suggested the URL as an ‘httpS://’ URL, a Secure Socket Layer gets used, so that No user will need to worry about the communication itself, to and from my server, being monitored by any third party.
Dirk