Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7037763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:35:04+00:00 2026-05-28T01:35:04+00:00

I’m just beginning to use CKEditor, but have a hard time understanding the plugins

  • 0

I’m just beginning to use CKEditor, but have a hard time understanding the plugins system.

I was able to add a simple button that says ‘Test’ when you click on it with :

  var myplugin_function = function () {
    alert('Test');
  }
  var plugin_name='myplugin';
  CKEDITOR.plugins.add(plugin_name,   
  {    
    init:function(c) {
      c.addCommand(plugin_name,myplugin_function);
      c.ui.addButton(plugin_name, 
      {
       label:'This is my plugin',
       command:plugin_name,
       icon:this.path+'myplugin.png'
      });
    }
  });

I know this code should be executed only once, for example in a plugin.js, but that’s not how I use it. The CKEditor instance, including my plugin code is executed each time the Ajax-page is loaded.

That’s why I use this to remove the instance, if it exists :

  if (CKEDITOR.instances['mytextarea']) {
    CKEDITOR.remove(CKEDITOR.instances['mytextarea']);
  }

Then I use the jquery way to create the ckeditor from a textarea:

$('#mytextarea').ckeditor();

But the 2nd time the ajax-page loads, I get an error about the plugin already being registered. So I need a way to remove the plugin and be able to add it again.

Is this even possible?

UPDATE

This seems to work :

I now check if the plugin is already registered with :

if (!CKEDITOR.plugins.registered[plugin_name]) {

}

around the CKEDITOR.plugins.add(b, … part

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:35:04+00:00Added an answer on May 28, 2026 at 1:35 am

    You are not showing how you are adding the plugin, so it’s hard to tell what’s your exact problem; but from the code that you have provided I can suggest that you use variable names better than “a”, “b” and “c”. It’s quite harder to understand the code this way.

    Also, CKEDITOR.remove just removes the instance from the instances array, but it doesn’t really clear the used resources, you should use CKEDITOR.instances[‘mytextarea’].destroy( true ) instead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.