【发布时间】:2012-06-16 01:58:14
【问题描述】:
我的 WordPress“编辑帖子”页面中的 TinyMCE 编辑器似乎坏了。 Chrome 控制台显示:
Resource interpreted as Script but transferred with MIME type text/html: "http://mysite.com/wp-includes/js/tinymce/langs/wp-langs-en.js?ver=349-20805". post.php:62
Resource interpreted as Script but transferred with MIME type text/html: "http://mysite.com/wp-includes/js/tinymce/tiny_mce.js?ver=349-20805". post.php:62
Uncaught SyntaxError: Unexpected token < tiny_mce.js:1
Uncaught ReferenceError: tinyMCE is not defined wp-langs-en.js:1
Uncaught ReferenceError: tinymce is not defined post.php:1180
如果我在 Chrome 开发者工具中检查 tinymce.js,我会看到以下响应标头:
Cache-Control:public, must-revalidate, proxy-revalidate
Connection:close
Content-Type:text/html
Date:Sat, 16 Jun 2012 01:40:42 GMT
Pragma:public
Server:Apache
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Powered-By:PHP/5.2.17, W3 Total Cache/0.9.2.4
这个回应:
<br />
<b>Parse error</b>: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in <b>/home/mysite/public_html/wp-includes/js/tinymce/tiny_mce.js</b> on line <b>1</b><br />
正在正确检索和执行各种其他 .js 文件。关闭 W3TC 没有任何区别。 Firefox 也存在问题。这个问题似乎突然出现了。我不知道我已更改任何内容,甚至没有更新或安装/卸载插件。
提前致谢。
【问题讨论】:
-
你确定你没有使用 php 在某处包含那个 js 文件吗?
grep -r -n -I --color /home/mysite/public_html/ tiny_mce.js,还是整个目录?还要检查 http conf 和该文件夹中的任何 .htaccess 或其任何父级是否没有将该文件/文件夹视为 php