| How to open and save files: a basic HTML editor in your publications |
This sample shows how to work with JQuery, JavaScript and HEScript to create a working basic HTML editor. For instance, you can load, edit and save files directly from a compiled publication. Working ExampleChoose Save As to save the contents of the text editor to an external HTML file. You will be prompted for the filename. After that, you can load contents from an existing HTML file with Load. Behind the sceneThe WYSIWYG editor is powered by a WYSIWYG JavaScript editor and jQuery. We use the following JavaScript code: <script src="editor.js" type="text/javascript"></script> The BODY tag contains: <script type="text/javascript"> When the end user clicks Save As, the JavaScript code saves the textarea's contents to a global variable and call the following HEScript script: uses Classes; // Add this to the top of the script procedure SaveFile; When the end user clicks Load, the JavaScript code calls the following HEScript script and then refreshes the page: procedure LoadFile; |
This is the online documentation of HTML Executable.
About HTML Executable
HTML Executable is a versatile HTML compiler and ebook compiler: it lets you create secure ebooks and desktop applications with your websites, HTML or PDF documents.
You can easily create attractive ebooks, full-featured HTML applications (RIA) and software, digital publications from your websites, PDF files and HTML documents for online or offline distribution.