Hello everyone
How can I get the HTML when the editor is in source view?
Currently I have an external function that gets the HTML via the following code:
However, if this function is run when the editor is in source mode it produces the following error:
Is there a way to get the source HTML when in source mode?
And is there a way to first work out which mode the editor is currently in?
How can I get the HTML when the editor is in source view?
Currently I have an external function that gets the HTML via the following code:
function getInnerHTML() { var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; return oEditor.EditorDocument.body.innerHTML; }
However, if this function is run when the editor is in source mode it produces the following error:
'EditorDocument.body' is null or not an object
Is there a way to get the source HTML when in source mode?
And is there a way to first work out which mode the editor is currently in?
Re: Getting the HTML when in source view
There are already built-in functions to retrieve HTML from FCKeditor like GetHTML() and GetXHTML() see wiki.fckeditor.net.
Answer to your second question:
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+