当我尝试将本地JavaScript文件的链接引用更改为GitHub原始版本时,我的测试文件停止工作.错误是:
拒绝从...执行脚本,因为它的MIME类型(
text/plain)不可执行,并且启用了严格的MIME类型检查.
有没有办法禁用此行为或是否有允许链接到GitHub原始文件的服务?
工作代码:
<script src="bootstrap-wysiwyg.js"></script>
Run Code Online (Sandbox Code Playgroud)
非工作代码:
<script src="https://raw.github.com/mindmup/bootstrap-wysiwyg/master/bootstrap-wysiwyg.js"></script>
Run Code Online (Sandbox Code Playgroud) 作为jQuery用户,我使用链接来自Google的远程库
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
这非常聪明,因为如果读者访问了另一个同样的网站,它已经被加载到浏览器缓存中.
当我发现Phaser时,我希望看到网络上的人也这样做
<script src="https://raw.githubusercontent.com/photonstorm/phaser/master/build/phaser.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
或任何图书馆主持人,但显然没有人这样做.
Phaser用户有没有这样做的原因?