Add a local jQuery fallback. #16888

Merged
merged 1 commit into from Jul 26, 2015

2 participants

@XhmikosR
Bootstrap member

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.

@XhmikosR XhmikosR added the docs label Jul 25, 2015
@XhmikosR XhmikosR added this to the v3.3.6 milestone Jul 25, 2015
@cvrebert cvrebert and 1 other commented on an outdated diff Jul 25, 2015
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>
@cvrebert
Bootstrap member
cvrebert added a note Jul 25, 2015

Perhaps omit the version from the filename for easier upgrading

@XhmikosR
Bootstrap member
XhmikosR added a note Jul 25, 2015

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
@cvrebert
Bootstrap member

Please find another reviewer for this.

@XhmikosR
Bootstrap member

Not sure what you mean. The patch is pretty straightforward, isn't it?

@cvrebert
Bootstrap member

Yes, but I DGAF about the underlying issue, so I'm not a good person to review this.

@XhmikosR
Bootstrap member

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.

@cvrebert
Bootstrap member

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.

@XhmikosR
Bootstrap member
@XhmikosR XhmikosR Add a local jQuery fallback.
Shouldn't really happen, but China for example has blocked Google so this should help.
abdf41f
@XhmikosR
Bootstrap member

Used jquery.min.js as the filename.

@XhmikosR XhmikosR merged commit 9433924 into master Jul 26, 2015

2 checks passed

Details continuous-integration/travis-ci/pr The Travis CI build passed
Details continuous-integration/travis-ci/push The Travis CI build passed
@XhmikosR XhmikosR deleted the jquery-local-fallback branch Jul 26, 2015
@mdo mdo referenced this pull request Jul 26, 2015
Closed

v3.3.6 ship list #16644

@cvrebert
Bootstrap member
cvrebert commented Sep 8, 2015

@XhmikosR Has this been ported to v4's docs?

@XhmikosR
Bootstrap member
XhmikosR commented Sep 8, 2015

I think it has, yes. And I added the missing fallback in 85ab831.

@cvrebert
Bootstrap member
cvrebert commented Sep 8, 2015

Superb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment