Closed oleteacher closed 5 years ago
Hi, @oleteacher
Is it an issue that the getContents method is not available?
If so, you must use returned object after creating the editor.
var editor = SUNEDITOR.create('editor', {
display: 'block',
width: '100%',
height: 'auto',
popupDisplay: 'full',
buttonList: [
['undo', 'redo'],
['font', 'fontSize', 'formatBlock'],
['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'],
['removeFormat'],
['fontColor', 'hiliteColor'],
['indent', 'outdent'],
['align', 'horizontalRule', 'list', 'table'],
['link', 'image', 'video'],
['fullScreen', 'showBlocks', 'codeView'],
['preview', 'print']
]
});
var textToWrite = editor.getContents();
var textFileAsBlob = new Blob([textToWrite], {type:'text/plain'});
var fileNameToSaveAs = "ecc.html";
...
Thanks : )
Thank you @JiHong88 ! That worked for us.
Not good with javascript and must take time to make my skills better:)
Thanks for taking time to help.
Hi. We are use to using CKEditor and TinyMCE and so easy to get the contents. Totally confused with SunEditor.
Below is a sample test save code we have been using in the "sample" folder. Could you take a look and make suggestion to get working?
Thanks!