简体   繁体   中英

MathType External Plugin for TinyMCE not working

I'm trying to integrate MathType into my TinyMCE editor but I get the following error:

Uncaught TypeError: tinymce.create is not a function
    at 2 (plugin.js:1:163253)
    at __webpack_require__ (plugin.js:1:208570)
    at plugin.js:1:208973
    at plugin.js:1:208997

I'm using the external plugin route as described here:

https://docs.wiris.com/mathtype/en/mathtype-integrations/mathtype-web-interface-features/external-integration.html

My code (partial):

function create_tinymce(element){
            //alert(element)
            document.getElementById("savePost").style.display = 'block';

            tinymce.init({
                selector: element,
                inline: true,
                //skin: 'jb',
                custom_elements: 'dictTerm',
                extended_valid_elements: 'dictTerm',
                content_css : 'css/stylesheet.css',
                menubar: false,
                toolbar: 'undo redo | table image | alignleft aligncenter bullist numlist | forecolor backcolor link | h2 calculationBox importantBox | tiny_mce_wiris_formulaEditor code',
                plugins: 'code image lists link preview table',
                external_plugins: { tiny_mce_wiris: 'https://www.wiris.net/demo/plugins/tiny_mce/plugin.js' },

I am also loading in jQuery and he tinyMCE plugin before the html loads:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.tiny.cloud/1/###APIKEYHIDDEN###/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
<script src="https://cdn.tiny.cloud/1//###APIKEYHIDDEN###/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
<script src="https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js"></script>

Does anyone know what might be going wrong? Any help would be greatly appreciated.

Thank you!

In order to solve the issue, is it possible that there are missing closing tags in your code?

tinymce.init({
    selector: '#additional-information',
    .
    .  
    .
}); ----> **this is missing?**

You can find more information here .

If you are still facing issues, please do not hesitate contacting us at support@wiris.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM