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

Which button? I see no “Lien” button (checked all captions).

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:

<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:

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. :rolleyes:

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

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.

@thetenfold Hi, Franky found the button and even showed its icon, thanks to him.

@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.

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 “#”).

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 :slight_smile: 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.

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.

At this moment, 2 files cannot be found:

The jQuery could be important?

BTW, the used !Doctype:

<!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 ([U]see here at w3c[/U]) is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

There are also [U]some other html-errors[/U] in the page.

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.

I also fixed all errors to make the validator green happy but it didn’t help with the issue on the plugin.

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 :wink: - 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”.

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