简体   繁体   中英

MIME type issue in JavaScript

I am working in a Web site. My <head> is like below.

<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>

But I am getting error 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).

在此处输入图片说明

Why I am seeing this error ?

  1. use rawgit.com instead of 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM