4

I don't know why but in console I have an error Uncaught ReferenceError: tinymce is not defined. Here is the file where I want to define TinyMCE

tinymce.init({
    selector: "textarea.tinymce"

});

Here is the HTML part

  <!--TinyMCE -->
                    <script type="text/javascript" src="/dashboard/plugins/tinymce/jquery.tinymce.min.js"></script>
                    <!--TinyMCE -->
                    <script type="text/javascript" src="/dashboard/plugins/tinymce/init-tinymce.js"></script>
                    <div class="form-group">
                        <label for="category"></label>

                        <textarea class="tinymce"></textarea>

                    </div>

Knows anybody what can I do?

Befee1975
  • 53
  • 2
  • 4
  • 10

2 Answers2

3

The process for installing the jQuery plugin version of TinyMCE is here:

https://www.tinymce.com/docs/get-started/advanced-install/#jqueryinstall

In particular you need to load both TinyMCE's main JS file (tinymce.min.js) and the jquery.tinymce.min.js jQuery plugin in order for this to work. For example:

<script src="/path/to/tinymce/tinymce.min.js"></script>
<script src="/path/to/tinymce/jquery.tinymce.min.js"></script>
Michael Fromin
  • 13,131
  • 2
  • 20
  • 31
0

Looks like your using the jQuery Version of TinyMCE, so the way your initialising the editor in your example is not the correct way.

you can continue to use the jQuery version or you can use the other version.

Normal Js file script

<script type="text/javascript" src="/dashboard/plugins/tinymce/tinymce.min.js"></script>

jQuery Initialise

$("textarea.tinymce").tinymce({
   //tinyMCE Settings here
 })

here is a post about it. : How do i use TinyMCE jQuery package and what is the difference with TinyMCE jQuery plugin

Community
  • 1
  • 1
Reiss Jarvis
  • 151
  • 8