TinyMCE在我的文本</script>中插入指向themes / advanced / langs / en.js的<script>标记

时间:2010-09-20 16:32:05

标签: tinymce

此问题存在先前的问题,但它没有发布解决方案。这是我没有编程的后端,但我现在正在维护这个问题。 TinyMCE以这种方式初始化:

tinyMCE.init({
    mode: "textareas",
    theme: "advanced",
    plugins: "style,paste",
    theme_advanced_buttons3_add : "pasteword",
    paste_auto_cleanup_on_paste: true,
    paste_remove_spans: true
});

现在我们发现IE中有一个JS错误的网站出现了错误:'themesMCE is undefined'在文件“themes / advanced / langs / en.js”的第1行。这是我们在使用TinyMCE编辑的其中一个文本中找到的代码:

<p style="text-align: left;">
<script src="../../../../js/kicms/tiny_mce/themes/advanced/langs/en.js" type="text/javascript"></script>
Como resultado de las actividades del sector en el mes de Julio de 2010, se registr&oacute; una variaci&oacute;n en los precios relevados en el canal SPM de

(...)

(文本的其余部分正常/好。)

为什么那个标签在那里?关于这个的任何线索? 非常感谢!

1 个答案:

答案 0 :(得分:0)

使用某些类型的压缩JavaScripts时,IE似乎存在问题。

我怀疑js / kicms / tiny_mce / themes / advanced / langs / en.js是一个压缩文件(在文本编辑器中打开以查看它是否混乱)。尝试使用未压缩的版本(人类可读)。

你对TinyMCE的看法应该是这样的:

<script type="text/javascript" src="<your installation path>/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

    // Theme options
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,

    // Example content CSS (should be your site CSS)
    content_css : "css/example.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "js/template_list.js",
    external_link_list_url : "js/link_list.js",
    external_image_list_url : "js/image_list.js",
    media_external_list_url : "js/media_list.js",

    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }
});
</script>

<form method="post" action="somepage">
    <textarea name="content" style="width:100%">
    </textarea>
</form>

另外,您可能想尝试下载最新版本的TinyMCE代码并尝试使用未压缩的文件:

http://tinymce.moxiecode.com/download.php

编辑:

对不起,我误会了。只需删除脚本标记,您的错误就会消失。我怀疑开发人员很匆忙而忘记删除标签。