typicaljoe / taffydb

TaffyDB - an open source JavaScript Database for your browser
http://taffydb.com
MIT License
2.21k stars 285 forks source link

Refused to execute script ("taffy.js" on Chrome) #113

Open rognoni opened 8 years ago

rognoni commented 8 years ago

I see this error on Google Chrome:

Refused to execute script from
'https://github.com/typicaljoe/taffydb/raw/master/taffy.js'
because its MIME type ('text/plain') is not executable, and strict MIME type checking
is enabled.
Uncaught ReferenceError: TAFFY is not defined

using this import:

<script src="https://github.com/typicaljoe/taffydb/raw/master/taffy.js"></script>

https://github.com/rognoni/adaptable/blob/master/Front-end/HTML5-Bootstrap4/index.html

rognoni commented 8 years ago

A possible simple solution :-) https://rawgit.com

mmikowski commented 8 years ago

This looks like a browser setting. Did you try this?

<script type="text/javascript" src="...">

rognoni commented 8 years ago

Yes, probably the content-type check is made from the resource headers:

  <!-- Libraries -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/js/bootstrap.js"></script>
  <script type="text/javascript" src="https://github.com/typicaljoe/taffydb/raw/master/taffy.js"></script>

from the Github server we have:

Content-Type: text/html; charset=utf-8