Can i know the content is edited? #5430
-
When user leave the editor page, if the user edit the content, and not saved to the server side, i want to give the user a message tell them leave will abord the edit part? so how can i know the content is edited? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Depends on if you have initial content, if you have initial content then you could use If you had initial content you could compare the initial content to the modified version and see if they are different. Or the simplest might even be to set a flag if there ever is an So there are many ways to tell this |
Beta Was this translation helpful? Give feedback.
Yea that could do it.
You can also do the parsing before it goes into the editor (to see what the editor would create) and use that as the comparison point.
I've written this before:
Call
.toJSON()
to get the JSON version if you don't want fragments or nodes