tags:

views:

51

answers:

2

I have a few different applications that use TinyMCE and all experience the same problem... the pages (randomly it seems) show HTML source code to the user. When I use the inspector, I see that the reason is that I get an entire script embed tag pointing to the /themes/advanced/langs/en.js file put into the middle of another HTML element. I've seen it show up inside tables and links, and it's even getting submitted to the DB through the TinyMCE editors themselves.

I see no console logs with JS errors, and the problem happens on only about 1/4 of all requests.

Here's my init:

<script type="text/javascript"> 
tinyMCE.init({
    mode : "textareas",
    plugins : "paste,spellchecker, table",
    paste_auto_cleanup_on_paste : true,
    theme : "advanced",
    theme_advanced_buttons1 : "spellchecker,separator,pastetext,pasteword,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,separator,code",
    theme_advanced_buttons2: "tablecontrols",
    theme_advanced_buttons3: "",
    theme_advanced_buttons4: "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    width : "700",
    height: "500"
});
</script> 
A: 

Do you include tinyMCE right before your initialization script? In some cases including tinyMCE after the init part might be the problem...

SleepyCod
TinyMCE was added before the init script.
Dan Bowling
Are the scripts included in the head of the page?
SleepyCod
A: 

I don't know how in the world this could be related to my issue, but I haven't seen the problem reappear after I made a setting change in IIS. I added a web garden to handle load issues and this problem has not been seen since.

It's a purely anecdotal solution though.

Dan Bowling