Reputation: 7533
var oEditor = FCKeditorAPI.GetInstance("<%=FCKeditorSelfDocument.ClientID %>");
var oDOM = oEditor.EditorDocument;
oDOM.body.innerText = 'Hello';
it is working fine in IE and chrome but not working in firefox 3.6.4
Upvotes: 0
Views: 1248
Reputation: 21117
FireFox does not use innerText:
'innerText' works in IE, but not in Firefox
Upvotes: 1
Reputation: 7533
IE uses document.all that's why it supports the format but there is a work around for firefox
var oEditor = FCKeditorAPI.GetInstance("<%=FCKeditorSelfDocument.ClientID %>");
var oDOM = oEditor.EditorDocument;
if (document.all)
{
oDOM.body.innerHTML = 'hello';// for IE
}
else //For firefox
{
var geckoRange = oDOM.createRange();
geckoRange.selectNodeContents(oDOM.body);
geckoRange = 'hello';
oDOM.body.innerHTML = geckoRange;
}
now it work for both
Upvotes: 0