![](/img/trans.png)
[英]GeoJSON file: Refused to execute script from because its MIME type ('') is not executable, and strict MIME type checking is enabled
[英]Refused to execute script from 'file_name.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類型檢查已啟用。
我的網站網址是http://www.mahijat.tk/new/
我的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" />
這通常是Chrome錯誤,發生在您向返回javascript但錯誤地發送Content-Type: text/html
標頭的頁面發出AJAX jsonp
請求時發生。
您可以通過在輸出javascript之前更改autoptimize_.....php
文件以發送適當的Content-Type標頭來解決此問題:
<?php
header('Content-Type: application/javascript');
// rest of the code
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.