Search code examples
javascripthtmlasp.netckeditorckeditor4.x

TypeError: c.lang.link is undefined with ckeditor


I get the following error when I click on Generate button

TypeError: c.lang.link is undefined

and this error disappeared when I open the developer tools with clicking on Generate button again.

My User control :

<asp:Button ID="btn_generate" runat="server" Text=" Generate" CssClass="btn btn-primary" OnClick="btn_generate_Click" /></td>
<div  runat="server" visible="false" id="editor_pnl">

<textarea name="editor1" id="editor1" runat="server" ValidateRequestMode="Disabled" enableviewstate="true" rows="40" cols="60"></textarea>
 </div>


<script>

    var langConfig = document.getElementById('<%= hf_lang.ClientID %>').value;
    CKEDITOR.replace('ContentPlaceHolder1_UC_HR_editor1', {
        allowedContent: true,
        height: '650px',
        defaultLanguage: langConfig.split('|')[0],
        contentsLangDirection: langConfig.split('|')[1]
    });

</script> 

So It's a weird behavior, the error appear if the developer tools is closed!


The Page containing the control:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="ckeditor/ckeditor.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="elementscontainer">
        <br />
        <div class="center-block">
            <uc:UC_HR runat="server" ID="UC_HR" />
        </div>
    </div>
</asp:Content>


Solution

  • This happens only with the Optimized version!, So After trying to use the not optimized version, every thing goes okay, So I think it's something related to the optimization process.