I'm trying to use the same page for displaying information and for administrators to edit it.
In principle, this should be easy enough by simply hiding the editing area via:
document.getElementById('Editing_Area').style.display="none";
However when I do this,(after displaying the area again), the FCKEditor doesn't work. It displays ok,
but generates this error:
uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://www-new.ex.ac.uk/fckeditor/edito ... e_gecko.js :: anonymous :: line 30" data: no]
GetType("A")fckeditorcode_gec... (line 58)
InitializeBehaviors("Unlink")fckeditorcode_gec... (line 31)
FCKDialogCommand()fckeditorcode_gec... (line 66)
FCKToolbarButton()fckeditorcode_gec... (line 78)
D(Object Name=html Status=2 EditMode=0 HasFocus=false)fckeditorcode_gec... (line 89)
D(Object Name=html Status=2 EditMode=0 HasFocus=false)fckeditorcode_gec... (line 89)
FCKEvents("OnStatusChange", 2)fckeditorcode_gec... (line 29)
GetLinkedFieldValue(2)fckeditorcode_gec... (line 30)
WaitForActive(Object Name=html Status=2 EditMode=0 HasFocus=false, 1)fckeditor.html (line 171)
FCKEvents("OnStatusChange", 1)fckeditorcode_gec... (line 29)
GetLinkedFieldValue(1)fckeditorcode_gec... (line 30)
_FCK_EditingArea_OnLoad()fckeditorcode_gec... (line 30)
CreateBogusBR()
Curiously, hiding the area with:
document.getElementById('Editing_Area').style.visibility='hidden' doesn't break the editor, but where there is an image in the textarea, the outline of the image is not hidden (in IE 6 anyway).
This method isn't actually what I'd like to use in this case
as it retains the DIV block as if it were there, so provides an empty space.
Any solutions/fixes/suggestions would be greatly appreciated.
Many thanks
Jamie Aylward
Tue, 05/01/2007 - 03:03
#1