Add a local jQuery fallback. #16888
docs/examples/blog/index.html
| @@ -169,6 +169,7 @@ <h2 class="blog-post-title">New feature</h2> | ||
| ================================================== --> | ||
| <!-- Placed at the end of the document so the pages load faster --> | ||
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | ||
| + <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery-1.11.3.min.js"><\/script>')</script> |
|
Perhaps omit the version from the filename for easier upgrading I thought about it, but I went with this. I don't have any strong opinion since GitHub doesn't really cache the CSS/JS files for a long time, so it should be OK if we use the same filename.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
I know for sure GitHub pages set the cache to like 10 min for CSS and JS files so it's OK (for now at least).
Generally, it's always preferable to use a distinct filename for caching issues.
I know for sure GitHub pages set the cache to like 10 min for CSS and JS files so it's OK (for now at least).
Right, it's just that having to modify 15 files to upgrade the jQuery version in the future seems potentially annoying.
True but it'd just be a search and replace.
I'll make a new patch tomorrow with this change.
…
I think it has, yes. And I added the missing fallback in 85ab831.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't really happen, but China for example has blocked Google so this should help.
Fixes #16886.
/CC @cvrebert
PS. I skipped template.html on purpose.