簡體   English   中英

JavaScript 中的 MIME 類型問題

[英]MIME type issue in JavaScript

我在一個網站工作。 我的<head>如下所示。

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">

    <script type="text/javascript" src="http://github.com/mrdoob/three.js/blob/dev/build/three.min.js"></script>
    <script type="text/javascript"
        src="http://github.com/pchen66/panolens.js/blob/master/build/panolens.min.js"></script>

    <script>
        const panorama = new PANOLENS.ImagePanorama('./images/project.jpg');
        const viewer = new PANOLENS.Viewer();
        viewer.add(panorama);
    </script>
</head>

但我收到錯誤The resource from “https://github.com/pchen66/panolens.js/blob/master/build/panolens.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

在此處輸入圖片說明

為什么我看到這個錯誤?

  1. 使用 rawgit.com 而不是 github.com
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">

    <script type="text/javascript" src="https://rawgit.com/mrdoob/three.js/dev/build/three.min.js"></script>
    <script type="text/javascript"
        src="https://rawgit.com/pchen66/panolens.js/master/build/panolens.min.js"></script>

    <script>
        const panorama = new PANOLENS.ImagePanorama('./images/project.jpg');
        const viewer = new PANOLENS.Viewer();
        viewer.add(panorama);
    </script>
</head>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM