tags:

views:

41

answers:

1

There is a previous question to this issue but it has no posted solution. This is for a backend I didn't programmed but I'm mantaining right now and there's this issue. TinyMCE is initialized this way:

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

And now we found an error for one of our sites with a JS error in IE: 'tinyMCE is undefined' on line 1 of file "themes/advanced/langs/en.js". This is the code we found in one of the texts edited with 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

(...)

(The rest of the text is normal/OK.)

Why is that tag in there? Any clue about this? Thanks a lot!

A: 

It appears there is a problem for IE when using certain types of compressed JavaScripts.

I suspect that js/kicms/tiny_mce/themes/advanced/langs/en.js is a compressed file (open in a text editor to see if it is jumbled). Try using an uncompressed version (human readable).

Your call to TinyMCE should look something like this:

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

Plus, you may want to try downloading the latest version of TinyMCE code and try it with the uncompressed files:

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

EDIT:

Sorry, I misunderstood. Just remove the script tag and your error should go away. I suspect a developer was in a hurry and forgot to remove the tag.

Todd Moses
The bad thing is that my IE error is in a page that only displays text, it's a front-end page that displays the text edited in the back-end, there's no TinyMCE in that page, but the script tag is "saved" into the text when editing it in the backend.
Alejandro García Iglesias
Just remove the script tag, it must of been left in by mistake. Then it should work without the error.
Todd Moses
I did removed the tag from the database text field, but it seems to be added to the text when the users creates a new record.
Alejandro García Iglesias
You will need to find the code that generates the text and remove it from there.
Todd Moses