hi all,
is there any "good" method to detect if the document was modified by the user? I tried
At onLoad of FCKEditor
originalContent = document.frames["wwContent"].objContent.DOM.body.innerHTML;
Later:
var curVal = document.frames["wwContent"].objContent.DOM.body.innerHTML;
if( originalContent != curVal ) return true;
But this fails always reproducable the first time I use the editor after starting IE and works fine after any further reload. Thats is why I am seeking for a better alternative.
Any ideas?
is there any "good" method to detect if the document was modified by the user? I tried
At onLoad of FCKEditor
originalContent = document.frames["wwContent"].objContent.DOM.body.innerHTML;
Later:
var curVal = document.frames["wwContent"].objContent.DOM.body.innerHTML;
if( originalContent != curVal ) return true;
But this fails always reproducable the first time I use the editor after starting IE and works fine after any further reload. Thats is why I am seeking for a better alternative.
Any ideas?
RE: Detect whether a document was changed
You could try taking an MD5 Hash of the content before and doing an MD5 Hash after you complete to make sure they haven't changed, wouldn't eat up as much memory but might be too CPU intensive...
search for an MD5 Hash algorithm in Javascript and try that.
RE: Detect whether a document was changed
What is the best way of retrieving the initial editor content in fckeditor.html, which event would suffice? Maybe saving the value only one time at onEditing?
Thank you, Dennis
RE: Detect whether a document was changed
RE: Detect whether a document was changed