Skip to content

Save

Once a page is created, the next step would be to save it. For that, the Froala Pages has built-in method for getting the HTML of the newly created page. Below is a basic example of creating a custom button where we save the generated content.

<script>
FroalaPages.Button.Register('save', {
title: 'Save',
icon: {
type: 'html',
template: 'Save'
},
callback: function () {
// Display saved HTML.
console.log(await this.page.getHTML());
}
})

// Init pages.
new FroalaPages({
pageRightButtons: [
['save']
]
})
</script>

Save on the server

Once you get the HTML from the Froala Pages, we recommend to make an AJAX request over to your server and store the HTML so that you can load it back further on.

File: 942