tags:

views:

21

answers:

0
$('a[id$=slideToggle]').click(function()
                {if (typeof (FCKeditorAPI) != 'undefined')
                    {
                        var oEditor = FCKeditorAPI.GetInstance("<%=FCKeditorSelfDocument.ClientID %>");
                        var oDOM;
                        if (typeof (oEditor) != 'undefined')
                        {
                            oDOM = oEditor.EditorDocument;
                        }
                        else
                        {
                            var oEditor = window.parent.InnerDialogLoaded().FCK;
                            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;
                    }
                });
            });

some type it is running fine but some time it is throwing exception oEditor is undefined what am i doing wrong. one thing is it is inside update panel is it the reason of this exception please suggest me some solutions

related questions