【问题标题】:TinyMCE wont show on Firefox, works in IE9TinyMCE 不会在 Firefox 上显示,在 IE9 中工作
【发布时间】:2013-10-03 18:38:46
【问题描述】:

我使用的是TinyMCE 4.0.6 版,它在IE9 中运行良好,但在Firefox 中什么也没有显示,甚至连它所连接的textarea 也没有。

我的代码是这样的:

<head>
    <link href="~/Styles/CSS/Layout.css" rel="stylesheet" />
    <script src="~/Scripts/Addons/TinyMCE/tinymce.min.js"></script>
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

    <script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        theme: "modern",
        plugins: [
            "advlist autolink lists link image charmap print preview hr anchor pagebreak",
            "searchreplace wordcount visualblocks visualchars code fullscreen",
            "insertdatetime media nonbreaking save table contextmenu directionality",
            "emoticons template paste textcolor moxiemanager"
        ],
        toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
        toolbar2: "print preview media | forecolor backcolor emoticons",
        image_advtab: true,
        templates: [
            { title: 'Test template 1', content: 'Test 1' },
            { title: 'Test template 2', content: 'Test 2' }
        ]
    });
    </script>
</head>
<body>
    <form action="" method="post">
         <textarea name="content" ></textarea>
    </form>
</body>

CSS:

textarea {
    width:100%;
    min-width:290px;
    height:100px;
}

【问题讨论】:

  • 相关,但不是问题的答案:您可能不应该使用~ 来引用网站上的文件。使用 html 文件所在的相对路径以获得最佳效果。
  • 另外,您的 javascript 控制台中是否出现任何错误,或者没有错误并且只是不显示?
  • 完全没有错误。它只是不会在 FF 中显示
  • 我对您在 chrome 和 firefox 中工作的代码感到困惑。为了完成这项工作,我唯一需要做的就是删除“moxiemanager”,这会导致错误:jsfiddle.net/4VZZU
  • 太棒了,很高兴它成功了!我会将其添加为答案,以便在其他人检查此问题时将其标记为已解决。

标签: html css internet-explorer firefox tinymce


【解决方案1】:

事实证明,这里的问题在于名为 MoxieManager 的 TinyMCE 插件,该插件未正确加载并导致跨浏览器出现问题。删除后,它开始在所有浏览器上运行。

这是 OP 设置的 jsfiddle 复制品:http://jsfiddle.net/4VZZU

这是修改后的plugins 数组:

plugins: [
            "advlist autolink lists link image charmap print preview hr anchor pagebreak",
            "searchreplace wordcount visualblocks visualchars code fullscreen",
            "insertdatetime media nonbreaking save table contextmenu directionality",
            "emoticons template paste textcolor"
        ],

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-03
    • 2012-01-28
    • 2012-11-27
    • 2023-03-10
    相关资源
    最近更新 更多