views:

20

answers:

2

i want to print some default string value in bold but i am using tag but it is not rendered as bold rather it is showing it is printing the same etc

var defaultFCKValue = '----Original Message---- \n';
            defaultFCKValue += '<b>From:</b> ' + from + '\n';
            defaultFCKValue += '<b>Sent:</b> ' + date + '\n';
            defaultFCKValue += $('div.popupContent div div.message').html();
            var oEditor = FCKeditorAPI.GetInstance("<%=FCKeditorSelfDocument.ClientID %>");
            var oDOM = oEditor.EditorDocument;
            oDOM.body.innerText = defaultFCKValue;
A: 

Try <strong> rather than <b>, as <b> tags have been depreciated in most doctypes. It may not directly solve your problem, but it is at least good practice.

ca8msm
no i tried both none of them works
Mac
+2  A: 

The problem is that the <b> tags are being escaped/encoded and are being rendered as &lt;b&gt;

You might want to try using

oEditor.setHtml(defaultFCKValue)

See the js docmentation for fckeditor.

mikek3332002
not working i tried but it is throwing exception
Mac
what kind of exception?(I've only been reading the website)
mikek3332002