TinyMCE: Check if TinyMCE is available
Question by Guest | Last update on 2021-04-06 | Created on 2014-05-06
I would like to show the TinyMCE HTML Editor only to a special group of the users of my website. The normal user is not allowed to use the editor.
So, I include the TinyMCE files dynamically only if necessary.
Because I am using the same JavaScript code for all users, the line with tinymce.init() is also written in the code in cases, TinyMCE is not available at all. So, in this case it, the function is unknown leading to errors when executing the code.
So, what I need is a function to check whether TinyMCE is available on not. Only if it is available, I would run the initialization with tinymce.init(). Is there any possibility to check that?
Related Topics
TinyMCE Editor not shown after second call
Question | 3 Answers
TinyMCE: Do not convert Special Characters to Named Entities
Question | 1 Answer
TinyMCE: Remove TinyMCE Editor from Textarea
Question | 1 Answer
PHP: Check Strings with Ctype-Functions for Character Classes
Article | 0 Comments
TinyMCE should use <b> and <i> instead of <strong> and <em>-tags
Question | 4 Answers
jQuery: Does an Element exist?
Tip | 1 Comment
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
You can just check whether typeof(tinyMCE) is defined:
Only if typeof(tinyMCE) is not undefined, the tinymce.init() will be executed.
Last update on 2021-04-06 | Created on 2014-05-06