This is driving me completely mad. I am writing a plugin that strips rubbish (eg. MS-Word garbage) from either the entire document (easy) or the current selection (fiendishly difficult!)
Firstly, just getting the currently selected XHTML doesn't seem possible in Firefox. I've tried such methods as:
var sHTML = oEditor.FCK.EditorWindow.getSelection().toString()
but it keeps just returning the text (not the HTML)
In IE I can do this:
var sHTML = oEditor.FCK.EditorDocument.selection.createRange().htmlText;
And it returns the XHTML which I can then process.
I am really tearing my hair out with this one, so if anyone has any idea I would love to hear them.
If I can get this to work, I will release the plugin to everyone.
Thanks
Ben
Firstly, just getting the currently selected XHTML doesn't seem possible in Firefox. I've tried such methods as:
var sHTML = oEditor.FCK.EditorWindow.getSelection().toString()
but it keeps just returning the text (not the HTML)
In IE I can do this:
var sHTML = oEditor.FCK.EditorDocument.selection.createRange().htmlText;
And it returns the XHTML which I can then process.
I am really tearing my hair out with this one, so if anyone has any idea I would love to hear them.
If I can get this to work, I will release the plugin to everyone.
Thanks
Ben