You are not logged in.
Pages: 1
Hi There ,
I am dynamically creating and removing a html area for a page (its used for the extended portion of a blog post
so for short posts its just unnecessary). However, before I remove it from the page I want to save its content,
it case the user changes their mind and turns in back on.
I create the neweditor like this
eeditor = new HTMLArea("eextended",HTMLArea.cloneObject(xinha_config));
eeditor.registerPlugins(xinha_plugins);
eeditor.generate();
what is being replaced is a textarea that I create on the fly like this
eeditor = document.createElement("TEXTAREA");
eeditor.value = extendedbody;
td1.appendChild (document.createTextNode("Extended Body"));
eeditor.rows=20;
eeditor.cols=80;
eeditor.name="eextended";
eeditor.id="eextended";
eeditor is a global variable so I can get hold of it later, now when , just before the htmlarea is removed, i try
and access the current content to store it
extendedbody=eeditor.getHtml();
I get a object does not support this property or method
I have the getHtml plugin registered in the config file
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'CharacterMap',
'ContextMenu',
'FullScreen',
'ListType',
'Stylist',
'InsertAnchor',
'FindReplace',
'Equation',
'SuperClean',
'GetHtml',
'TableOperations'
];
And I can see the other plugins are loaded, so does anyone have any ideas as to where I am going wrong?
Thanks
Sean
Offline
Just gave that a try, it made no difference
Offline
That indicates that the problem is not in the plugin or your config. You seem to be using the variable eeditor for two different purposes, one as the name of the editor object, the other as the name of the textarea. When you execute the line 'extendedbody=eeditor.getHtml();', does eeditor refer to the textarea? If so, that's your problem. getHTML() only applies to the editor object.
Offline
I am a moron (*Sound of head smacking wall repeatedly*)
I downloaded and installed venkman (not working off my own laptop , it blew up last week and Im waiting for the replacement), and verified that eeditor was indeed pointing at the editor object. So I started fooling around with some watches, and ........
I was calling .getHtml() instead of .getHTML(), HTML has to be in caps, doh doh doh
Thank you all very much for your help
Sean
Offline
Pages: 1