SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CKEditor cryptic DOM exception

    Hello,

    I get a not so verbose error message here: Uncaught Error: NotFoundError: DOM Exception 8

    You can see it (On Chromium and Firefox at least where I tested it) at the page:

    http://www.learnintouch.com/ckeditor4.html

    Select some content and lick the toolbar button with the missing caption (I shall fix the caption later on), the one in color, left of the button with the caption "Lien".

    If you can lead me even one step that'd be very helpful.

    Kind Regards,

    Stephane

  2. #2
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    13
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Which button? I see no "Lien" button (checked all captions).

  3. #3
    SitePoint Evangelist silver trophybronze trophy
    Join Date
    Jul 2013
    Posts
    406
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    The "Lien" button is the link button in the center of the first row.
    Left is this green colored button:
    The html of the button is:
    HTML Code:
    <a onclick="CKEDITOR.tools.callFunction(61,this);return false;" 
    onmousedown="return CKEDITOR.tools.callFunction(60,event);" 
    onfocus="return CKEDITOR.tools.callFunction(59,event);" 
    onkeydown="return CKEDITOR.tools.callFunction(58,event);" 
    onblur="this.style.cssText = this.style.cssText;" 
    aria-haspopup="false" aria-labelledby="cke_33_label" 
    role="button" hidefocus="true" tabindex="-1" title="{title}" 
    class="cke_button cke_button__internallink  cke_button_off" id="cke_33">
       <span style="background-image:url(http://www.learnintouch.com/engine/js/editor/ckeditor_4.2.1/plugins/internalLink/images/internalLink.png?t=D8AD);background-position:0 undefinedpx;background-size:16px;" 
       class="cke_button_icon cke_button__internallink_icon">&nbsp;</span>
       <span aria-hidden="false" class="cke_button_label cke_button__internallink_label" id="cke_33_label">{label}</span>
    </a>
    A click on it lets the javascript console say:
    Code:
    Error:       TypeError: Value not an object.
    Source file: http://www.learnintouch.com/engine/js/editor/ckeditor_4.2.1/ckeditor.js
    Line:        73
    More I cannot say: short of knowledge about the ckeditor.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,234
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    Seeing the inline javascript like that makes me shudder.

    Anyway, my guess is that the "this" is what's causing the problem.

    Did you see the code you posted somewhere as the correct way, or are you just "trying" it?

    EDIT
    I'm fairly certain it's the "this" now.
    Clicking on the link in Firefox's error console highlights this portion of the js file
    Code Javascript:
    b):this.removeAttribute("class")}return this},hasClass:function(a){return RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(a,b){typeof a=="string"&&(a=this.getDocument().createElement(a));b?this.$.insertBefore(a.$,this.$.firstChild):this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var b=new CKEDITOR.dom.element("div",this.getDocument());b.setHtml(a);b.moveChildren(this)}else this.setHtml(a)},appendText:function(a){this.$.text!=

    Because the selected text has no "class" attribute? Seems the code would account for the possibility.

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @thetenfold Hi, Franky found the button and even showed its icon, thanks to him.

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Mittineague This code is mine and I took some time to make it work on the previous versions of the CKEditor. It worked fine until and including the 3.6.5. I followed the documentation carefully and did no tweaking nor fancy stuff of any sort.

  7. #7
    SitePoint Evangelist silver trophybronze trophy
    Join Date
    Jul 2013
    Posts
    406
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Ah, now I see the link <a> for the button (see message #3) has all kinds of attributes, but not the href="...".
    Maybe adding an empty href="#" can give the "this" a hook to work? (with the "return false" is doesn't really go to "#").

  8. #8
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Francky, Thanks for your input. I however don't think it should be the cause for the issue. I should have told you more about this so as not to let you drift off :-) There are two other buttons, the two with the capital L letter left of the one I have the issue with. These two L buttons are also plugins of mine. They also display an <a> element without the attribute you spotted. And these two buttons do work fine even now.

  9. #9
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only difference my troublemaker button has with the others, it's that it opens up a dialog. But I wonder if this could be a reason for the issue.

  10. #10
    SitePoint Evangelist silver trophybronze trophy
    Join Date
    Jul 2013
    Posts
    406
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    At this moment, 2 files cannot be found:

    The jQuery could be important?

    BTW, the used !Doctype:
    HTML Code:
    <!doctype html public '-//w3c//dtd html 4.01 transitional//en'>
    is invalid, and will put Internet Explorer in Quirks Mode (like it is IE5).
    The regular call (see here at w3c) is:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    There are also some other html-errors in the page.

  11. #11
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops ! I had removed the jquery-1.10.2.min.js yesterday to reverse back to 1.7.1 and forgot about this ckeditor4.html bug demo file. It makes no difference for the issue anyway. The issue also appeared with jquery-1.7.1.min.js in fact.

    I removed the _languages.js file which is not being used at all. It's a legacy file.

    Thanks for the doctype mention, I updated it.

  12. #12
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also fixed all errors to make the validator green happy but it didn't help with the issue on the plugin.

  13. #13
    SitePoint Evangelist silver trophybronze trophy
    Join Date
    Jul 2013
    Posts
    406
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    The only difference my troublemaker button has with the others, it's that it opens up a dialog. But I wonder if this could be a reason for the issue.
    I don't think so, as the common Link button is also opening a dialog file.


    But I'm only guessing, for I don't know anything about the (rather complicated) ckeditor.
    I would point you to the ckeditor forum, but then I saw you are there already - no answers yet...

    I hope here or there some ckeditor expert will pass by to solve your problem!

    Edit:

    Maybe it can help if you asked a moderator to change the title of this topic in "ckeditor problem".

  14. #14
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Francky,

    Thanks for these comments. One thing to note is that the common Link button you mention is not my plugin, it is shipped by default with the editor. Only the Internal Link button is mine.

    Stephane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •