tags:

views:

24

answers:

0

i am using a link on clicking of which i am displaying an fckeditor with some default values in it for first 8-10 operation it is working fine after that it is generating script error FCKeditor is not defined the code i have written is

$('a[id$=slideToggle]').click(function()
        {
            // Add the original message by default in the FCKEditor text area
            // along with the sender name and date.
            var defaultFCKValue = '<br />----Original Message---- <br />';
            defaultFCKValue += '<b>From:</b> ' + from + '<br />';
            defaultFCKValue += '<b>Sent:</b> ' + formattedDate.toLocaleDateString() + '<br /><br />';
            defaultFCKValue += $('div.popupContent div div.message').html();

            // Create an instance of FCKEditor.
            if (typeof (FCKeditorAPI) != 'undefined')
            {
                var oEditor = FCKeditorAPI.GetInstance("ctl00_ContentPlaceHolder1_FCKeditorSelfDocument");
                var oDOM;
                if (typeof (oEditor) != 'undefined')
                {
                    oDOM = oEditor.EditorDocument;
                }
                if (typeof (oDOM) != 'undefined')
                {
                    if (document.all)
                    {
                        oDOM.body.innerHTML = defaultFCKValue;
                    }
                    else
                    {
                        var geckoRange = oDOM.createRange();
                        geckoRange.selectNodeContents(oDOM.body);
                        geckoRange = defaultFCKValue.toString();
                        oDOM.body.innerHTML = geckoRange;
                    }
                    return false;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        });

related questions