【问题标题】:MathType External Plugin for TinyMCE not workingTinyMCE 的 MathType 外部插件不工作
【发布时间】:2022-12-29 22:01:51
【问题描述】:

我正在尝试将 MathType 集成到我的 TinyMCE 编辑器中,但出现以下错误:

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

我正在使用此处描述的外部插件路由:

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

我的代码(部分):

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' },

在加载 html 之前,我也在加载 jQuery 和他的 tinyMCE 插件:

<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>

有谁知道可能出了什么问题? 任何帮助将不胜感激。

谢谢!

【问题讨论】:

    标签: plugins tinymce external mathtype


    【解决方案1】:

    为了解决这个问题,您的代码中是否可能缺少结束标记?

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

    你可以找到更多信息here。

    如果您仍然遇到问题,请随时通过 support@wiris.com 联系我们

    【讨论】:

    • 谢谢您的回复!我检查了一下,不幸的是,这似乎不是问题所在。我在这里将我的代码大量简化为小提琴:jsfiddle.net/ilyas415/4xsc517q/2 不幸的是它仍然对我不起作用。对你起作用吗?会不会是我浏览器的问题?
    猜你喜欢
    • 2022-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-08
    • 1970-01-01
    • 2022-12-04
    相关资源
    最近更新 更多