J 在 TinyMce.js 中为空 [英] J is null in TinyMce.js

查看:18
本文介绍了J 在 TinyMce.js 中为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用 tinymce,我总是遇到这个烦人的 j is null.在我的模板文件中,我最初将 init 方法打开,就像示例中一样...

I use tinymce on my website and I always run into this annoying j is null. In my template file I originally had the init method out in the open like in the example...

<script type="text/javascript" >
tinyMCE.init({
        mode : "textareas",
        theme : "simple"   
});
</script>

但在 Firefox 的错误控制台中,我看到j 为空"的内容,并且引用位于 tiny_mce.js 文件中的某处.任何帮助表示赞赏.非常感谢.

But in the error console of Firefox I see something that says "j is null" and the reference is somewhere within the tiny_mce.js file. Any help is appreciated. Thanks so much.

推荐答案

这是一个 tinymce 错误.在内部,tinymce 代码使用 <span id="mce_marker"></span> 来记住粘贴时的插入符号位置.在验证生成的片段时,粘贴后,跨度被视为无效并被删除,从而通过删除标记来破坏代码.此问题将在下一个官方 tinymce 次要版本中修复.对于此类问题,有一些解决方法.一种是在spans作为有效元素(初始化设置).示例:

It's a tinymce bug. Internally, the tinymce code uses a <span id="mce_marker"></span> to remember the caret-position when pasting. when validating the resulting fragment, after the paste, the span is deemed invalid and removed, thus breaking the code by removing the marker. This issue will be fixed in the next official tinymce minor release. There are some workarounds for this kind of issue. One is to add to add id and mce-data-type attribute to spans as valid elements (init setting). Example:

// The valid_elements option defines which elements will remain in the edited text when the editor saves.
    valid_elements: "@[id|class|title|style]," +
    "a[name|href|target|title]," +
    "#p,-ol,-ul,-li,br,img[src],-sub,-sup,-b,-i,-u" +
    "-span[data-mce-type]",

这篇关于J 在 TinyMce.js 中为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆