Doo*_*nob 30 javascript url edit github
我在script标签中有一些javascript代码的要点,如下所示:
<script src="https://raw.github.com/gist/b25dff23c2c4b4bd425a/f157aa95163311c4b58febb06b49ffd16419f642/images.js"></script>
Run Code Online (Sandbox Code Playgroud)
我需要继续在github上编辑JS文件.但是,当您编辑要点时,它会更改要点的URL.如何保留相同的URL?
小智 47
Gist更改了此文件模式的路径:
https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_REVISION_ID>/<GIST_FILE_NAME>
Run Code Online (Sandbox Code Playgroud)
你会注意到现在最热门的答案'链接是404'.
只需应用这种新模式并vo!
https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_FILE_NAME>
Run Code Online (Sandbox Code Playgroud)
例如:
https://gist.githubusercontent.com/wesbos/cd16b8b1815825f111a2/raw/lol.js
xtr*_*ist 17
在gist的情况下,
https://raw.github.com/gist/[gist_id]OR
https://gist.github.com/[user_name]/[gist_id]/raw(更可能是唯一的URI.)
从gist返回第一个文件.
对于包含多个文件的要点,请访问https://raw.github.com/gist/[gist_id]/[file_name]
即使您更改文件名,网址也会起作用.
例如https://raw.github.com/gist/4636655 https://raw.github.com/gist/4636655/imdb-getglue.js
只需添加/raw到您的要点网址的末尾.
https://gist.github.com/--user--/--id--/raw
Run Code Online (Sandbox Code Playgroud)
这链接到该文件的最新版本.
更新gist文件后,更改会在一两分钟后反映出来.
| 归档时间: |
|
| 查看次数: |
9111 次 |
| 最近记录: |