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 is currently Offline

Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)

Please post your question in the Forum and we will get back to you as soon as we can.

  Tuesday, 07 March 2023
  2 Replies
  436 Visits
Hi Ryan, Yannick from Weeblr here, hope you're doing well.

For several of my extensions (4SEO, 4Podcast and some more to come), I am in need for accessing the content editor with javascript.
Nothing fancy, things like:
- getting and setting the current editor content (as HTML)
- possibly getting user selection position, or getting the selected HTML

Both Joomla 3 and Joomla 4, but J4 is a priority.

Do you have some doc on how to "officially" do that? or what'd be your advice on the most compatible way to do this with JCE?

I mean by that: if I can have the same code for both Joomla TinyMCE and JCE, it's best.

Thanks for any pointer,

Yannick Gaultier
https://weeblr.com
more than a month ago
·
#113185
Accepted Answer
JCE does implement the Joomla Editor API functions (where id is the id value of the textarea) :


Joomla.editors.instances[id].getValue();
Joomla.editors.instances[id].setValue(value);
Joomla.editors.instances[id].getSelection();
Joomla.editors.instances[id].replaceSelection(value);

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#113185
Accepted Answer
JCE does implement the Joomla Editor API functions (where id is the id value of the textarea) :


Joomla.editors.instances[id].getValue();
Joomla.editors.instances[id].setValue(value);
Joomla.editors.instances[id].getSelection();
Joomla.editors.instances[id].replaceSelection(value);

Just because you're not paranoid doesn't mean everybody isn't out to get you.

yannickgaultier selected the reply #113185 as the answer for this post — 6 months ago
more than a month ago
·
#113186
Thanks, I had thought so but best to confirm!

Cheers
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!