Including JavaScript files from GitHub into HTML pages

后端 未结 7 847
北荒
北荒 2020-12-12 18:53

PAY ATTENTION!

You can\'t include Github scripts directly from Github after this change.

We added the X-Conte

相关标签:
7条回答
  • 2020-12-12 19:51

    You will be able to do it with a URL similar to this:

    https://rawgit.com/h5bp/html5-boilerplate/master/src/js/plugins.js
    

    Note that this is not the same as clicking on the "raw" button within GitHub; that button will also give you a clean version of the file, but it will be sent with the wrong headers.


    A Word of warning; the file is not not being served from GitHub. It is being redirected through the rawgit.com domain. As is stated on https://rawgit.com:

    Hey! rawgit.com is just for fun and is not associated with GitHub in any way.

    Keep in mind that the owner of that domain is now in control of the traffic and is able to manipulate it as they see fit.

    0 讨论(0)
提交回复
热议问题