[英]Refused to execute script from 'file_name.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled
I make a site. 我做一个网站。 It's working properly on my local server but when I upload it to live server it is giving me this error: 它在我的本地服务器上正常工作,但是当我将其上传到实时服务器时,出现此错误:
Refused to execute script from ' http://www.mahijat.tk/new/wp-content/cache/autoptimize/autoptimize_c648c3203309d095775637e672c00239.php ' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 拒绝执行来自' http://www.mahijat.tk/new/wp-content/cache/autoptimize/autoptimize_c648c3203309d095775637e672c00239.php '的脚本,因为其MIME类型('text / html')无法执行,并且必须进行严格的MIME类型检查已启用。
My site URL is http://www.mahijat.tk/new/ 我的网站网址是http://www.mahijat.tk/new/
My index.php
file code is 我的index.php
文件代码是
<!doctype html>
<html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js ">
<head><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="../pbs.twimg.com/profile_images/601407094277873664/WT2mk28E_400x400.jpg" />
<link type="text/css" media="all" href="wp-content/cache/autoptimize/autoptimize_ac4e9617d860b901a683f7676a3c44be.css" rel="stylesheet" />
<link type="text/css" media="all" href="wp-content/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
This is usually a Chrome error that happens when you make an AJAX jsonp
request to a page that returns javascript but incorrectly sends a Content-Type: text/html
header. 这通常是Chrome错误,发生在您向返回javascript但错误地发送Content-Type: text/html
标头的页面发出AJAX jsonp
请求时发生。
You can fix it by changing your autoptimize_.....php
file to send the proper Content-Type header before outputting the javascript: 您可以通过在输出javascript之前更改autoptimize_.....php
文件以发送适当的Content-Type标头来解决此问题:
<?php
header('Content-Type: application/javascript');
// rest of the code
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.