I can offer yet another spelling: In fck1.js, the function is defined as GetHTML(), but this is an attribute of class FCK, not of FCKeditor, so you would call it as
Please, don't do it that way or you'll have lots of problems as soon as the user puts any special code that it is internally transformed.
Use this code:
var oEditor = FCKeditorAPI.GetInstance( "FCKeditor1" ) ; // Get the editor contents as XHTML. GetXHTML var sContent= oEditor.GetXHTML( true ) ; // "true" means you want it formatted.
RE: Read value from editor with JavaScript
i have the same problem... have you managed to solve it?
thanks
RE: Read value from editor with JavaScript
function clear_editor(field){
editor = document.frames["iframe_"+field].document.getElementById("objContent")
editor.DOM.body.innerHTML = "";
}
RE: Read value from editor with JavaScript
RE: Read value from editor with JavaScript
FCKeditorAPI.__Instances[YOUR EDITOR NAME].GetHTML()
RE: Read value from editor with JavaScript
window.frames['FCKeditor1___Frame'].frames['eEditorArea'].document.body.innerHTML
worked.
I tried editor.getHTML(); no success.
RE: Read value from editor with JavaScript
be careful about the letter case
RE: Read value from editor with JavaScript
editor.FCK.GetHTML()
RE: Read value from editor with JavaScript
var theHTMLcontent = frames['FCKeditor1___Frame'].frames['eEditorArea'].document.body.innerHTML
hope it helps anyone that had my problem!!
RE: Read value from editor with JavaScript OK
I solve it..
var theHTMLcontent = frames['FCKeditor1___Frame'].frames['eEditorArea'].document.body.innerHTML
FCKeditor1 is editor object!!
previeos decleare..
var var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
RE: Read value from editor with JavaScript OK
Use this code:
var oEditor = FCKeditorAPI.GetInstance( "FCKeditor1" ) ;
// Get the editor contents as XHTML. GetXHTML
var sContent= oEditor.GetXHTML( true ) ; // "true" means you want it formatted.