Esscotti Web development & SEO

19Sep/090

TinyMCE not working in IE6 – solved

If you got TinyMCE working in most browsers except IE6 then first check how you reference the tinymce javascript file.

We had the following


<!-- TinyMCE -->
 <script type="text/javascript" src="../js/tiny_mce/tiny_mce.js"></script>
 <script type="text/javascript">
 tinyMCE.init({
 mode : "textareas",
 theme : "advanced"
 });
 </script>
 <!-- /TinyMCE -->

...which is wrong. The correct code is


<!-- TinyMCE -->
 <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
 <script type="text/javascript">
 tinyMCE.init({
 mode : "textareas",
 theme : "advanced"
 });
 </script>
 <!-- /TinyMCE -->

Note the src="/js/tiny_mce/tiny_mce.js" The problem was reported by a client that were using IE6 and could not upgrade to anything else for internal IT-policy reasons. We easily found the error by looking at the apache error logs on their virtual private server which showed.


[Thu Nov 19 13:20:13 2009] [error] [client xx.xx.xx.xx] Invalid URI in request GET /../js/tiny_mce/themes/advanced/editor_template.js HTTP/1.1, referer: http://www.example.com/admin/

It seems the client (the web-client, i.e. IE6) had introduced an extra slash '/' before the javascript filename. Hope this helps someone.