0

Hi guys. Does anyone know the counterpart of Javascript's .pasteHTML method in Firefox and other browsers? It works fine only in IE. I'm using an FCK Editor as my WYSIWYG control. Here is my code snippet:

var oFCKeditor = FCKeditorAPI.GetInstance(objname);
var selection = (oFCKeditor.EditorWindow.getSelection ? oFCKeditor.EditorWindow.getSelection() : oFCKeditor.EditorDocument.selection);
var sRange;
var sHtml;

//IE
if(selection.createRange) 
{
	sRange = selection.createRange();
	sHtml = sRange.htmlText;
}
//Other Browsers
else 
{
	sRange = selection;
	sHtml = sRange;
}

sRange.pasteHTML(str1 + sHtml + str2);

What I'm trying to do is to insert an HTML code to a selected range. I'd appreciate your help on this. TIA.

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by Troy III
0

There's none I'm afraid. Or at least not a coder-friendly one. Other browsers have just recently stared supporting some of rich-text html editor commands and already made a mess out of it. There are to many stunt steps required and hope for the best in the end for it to make it happen.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.