You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

  • Support
  • Forum
  • JCE Editor
  • Error in creating editor via Javascript - Uncaught TypeError: Cannot read property 'css' of undefined in editor_template.js
  1. raffaele.jacovelli
  2. JCE Editor
  3. Tuesday, 05 February 2019
Hi,

I'm getting the following error when initating tinymce via javascript:
Uncaught TypeError: Cannot read property 'css' of undefined
at the line 50 of
/components/com_jce/editor/tiny_mce/themes/none/editor_template.js
I'm using Joomla 3.8.8
Probably I'm missing something....
here is the code I'm using to create the editor:
tinymce.init({
theme : "none",
skin : "o2k7",
skin_variant : "silver",
mode : "specific_textareas",
editor_selector : "wf-editor mce_editable",
theme_advanced_toolbar_location : "top",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,"
+ "justifyleft,justifycenter,justifyright,justifyfull,formatselect,"
+ "bullist,numlist,outdent,indent",
theme_advanced_buttons2 : "link,unlink,anchor,image,separator,"
+"undo,redo,cleanup,code,separator,sub,sup,charmap",
theme_advanced_buttons3 : "",
height:"350",
width:"700",
max_width:"700",
selector: "#"+$(cvp).attr("id";)
});

please advise
thanks
Accepted Answer Pending Moderation
This


tinymce.init({
theme : "none",


should be


tinymce.init({
theme : "advanced",
Just because you're not paranoid doesn't mean everybody isn't out to get you.
  1. more than a month ago
  2. JCE Editor
  3. # 1
Accepted Answer Pending Moderation
Thanks for the reply,

I've changed and now I've the same error at another line:
ed.settings.compress.css || ed.settings.content_css === !1 || ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css";)),
  1. more than a month ago
  2. JCE Editor
  3. # 2
Accepted Answer Pending Moderation
You can't initialise JCE in the same way you would Tinymce.

Please use


WFEditor.init({
skin : "o2k7",
skin_variant : "silver",
mode : "specific_textareas",
theme_advanced_toolbar_location : "top",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,formatselect,bullist,numlist,outdent,indent",
theme_advanced_buttons2 : "link,unlink,anchor,image,separator,undo,redo,cleanup,code,separator,sub,sup,charmap",
theme_advanced_buttons3 : "",
height:"350",
width:"700",
max_width:"700",
selector: "#"+$(cvp).attr("id")
});


Please note: I don't support initialisation of the editor in this way, as it should be done through the Joomla editor API.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
  1. more than a month ago
  2. JCE Editor
  3. # 3
Accepted Answer Pending Moderation
Hi Ryan,

thanks for your kind reply.
I understand that you do not support this kind of calls. Usually I invoke the editor via php, and it works very well, but in this case as I need to insert the editor in the DOM in a new div created by clicking a button, I thought that I could do it only via jQuery, hence the need to initiate it that way.
I've tried anyway to follow your suggestion and I'e got a different error: Uncaught TypeError: Cannot read property 'indexOf' of undefined at the 3rd line of the functiongetSite, it seems that somehow the base is not defined.

In case you wish to give it a look this is the url of the testing page indicated in the url
https://www.hightechpartners.net/index.php?option=com_chronoforms&chronoform=CreateCRNew-Copy

I would really appreciate if you could further help. I'll be happy to pay extra charge for this.
Thanks and kind regards
Raffaele
  1. more than a month ago
  2. JCE Editor
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.