Closed teamrun closed 11 years ago
Could you show me some of your code that is causing the undefined to appear so I can reproduce it?
here, i init epiceditor in html file:
seajs.use("writer.js");
var editor = new EpicEditor().load();
then, i try to get editor's content after i write something in the it in writer.js.
newBlog = editor.exportFile('html');
and the newBlog could be undefined...
sorry to reply so late
Hmm, well, exportFile('html')
will try to export a file named html as plain text. Is that what you have have and want or did you want the current file to be exported as html? I assume that's what you wanted.
If you don't have a file named html
it'll return undefined because there's no localStorage file with that name. If you just want the current file do:
editor.exportFile('myFileName', 'html');
You can do null
if you don't know or care about the filename:
editor.exportFile(null, 'html');
I'm closing it for now since I assume this isn't a bug, you just were missing a param. If you're still having trouble reopen with more details :)
this happens occasionally: invoke exportFile method, and it returns undefined。
And then i try this method many times, appears that it return undefined every other time.
is it a bug?
waiting for your reply。