pls help me
my function is not working in IE, what wrong in script
function FCKeditor_OnComplete(editorInstance )
{
editorInstance.Events.AttachEvent( 'OnSelectionChange' , selectedtext ) ;
}
function selectedtext()
{
var editorInstance = FCKeditorAPI.GetInstance('FCKeditor1') ;
var selection = (editorInstance.EditorWindow.getSelection ? editorInstance.EditorWindow.getSelection() : editorInstance.EditorDocument.selection);
alert(getSelectionHTML(selection))
}
// get HTML from selection
function getSelectionHTML(selection)
{
var range = (document.all ? selection.createRange() : selection.getRangeAt(selection.rangeCount - 1).cloneRange());
if (document.all)
{
return range.htmlText;
}
else
{
var clonedSelection = range.cloneContents();
var div = document.createElement('div');
div.appendChild(clonedSelection);
return div.innerHTML;
}
}
my function is not working in IE, what wrong in script
function FCKeditor_OnComplete(editorInstance )
{
editorInstance.Events.AttachEvent( 'OnSelectionChange' , selectedtext ) ;
}
function selectedtext()
{
var editorInstance = FCKeditorAPI.GetInstance('FCKeditor1') ;
var selection = (editorInstance.EditorWindow.getSelection ? editorInstance.EditorWindow.getSelection() : editorInstance.EditorDocument.selection);
alert(getSelectionHTML(selection))
}
// get HTML from selection
function getSelectionHTML(selection)
{
var range = (document.all ? selection.createRange() : selection.getRangeAt(selection.rangeCount - 1).cloneRange());
if (document.all)
{
return range.htmlText;
}
else
{
var clonedSelection = range.cloneContents();
var div = document.createElement('div');
div.appendChild(clonedSelection);
return div.innerHTML;
}
}
Re: OnSelectionChange, onclick event not working in IE
Maybe my howto helps: 'HOWTO - Work with the selection in the editor', viewtopic.php?f=6&t=806
Also, note that the event function receives the editorinstance as a parameter, see http://docs.fckeditor.net/FCKeditor_2.x ... API#Events