- Getting Started
- Browser Support
- Languages Support
- Shortcuts
- Activation
- Examples
- Customize the Editor
- Use-cases
- Plugins
- APIs
- Development Frameworks
- Server Integrations
- Server SDKs
- Migration Guides
- Changelog
- Tutorials
Save Plugin
Enables AJAX saving of the content inside the editor, and you can set the editor to autosave the content and no worries then about data loss, Our rich text editor automatically makes a save request to your server as the user types.
Plugin options:
saveInterval Number - | Time in milliseconds that defines when the autosave should be triggered. Setting a higher interval helps prevent request overload on the server. The autosave will be triggered only if the content was changed from the last interval. Setting the value to 0 will disable autosave. Note: It is not recommended to use values lower than 2000ms in order to prevent overload. Default: 10000 |
saveMethod String - | The HTTP save request type. Default: 'POST' |
saveParam String - | The name of the parameter which contains the rich text editor's content on the save request. Default: 'body' |
saveParams Object - | Additional parameters passed to the save request. Default: {} |
saveURL String - | The URL where the save request is being made. The editor will initialize a HTTP request to the specified URL passing the editor's content in the body parameter of the HTTP request. Default: null |
Plugin methods:
save.force () returns: Object | Force a save request at the end of the current autosave interval. |
save.save () returns: Object | Initializes a save request to the URL specified by the saveURL option. |
save.reset () returns: Object | Restore the force request at the end of the current autosave interval. |
Plugin events:
save.after (data) . | Triggered after the save request. ● data The returned data from the save request |
save.before (html) . | Triggered before doing the save request. If a string is returned, the new string will be used as the saved content. Note: Returning false in the handler assigned to the event will cancel the current action. ● html The HTML to save. |
save.error (error, response) . | Triggered when an error occurs during save request. ● error The description of the error that happened during the save request. ● response The original response from the server. |
Add Plugin to your code:
Plugin name: save
Plugin JS Script: ../js/plugins/save.min.js
Or from CDN https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/save.min.js
Plugin CSS link: