LoginSignup
2

More than 5 years have passed since last update.

plan b for your js cdn

Posted at

lesson learned from HTML5 boilerplate:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="/front/try/js/vendor/jquery-1.8.0.min.js"><\/script>')</script>

The window.jQuery will check if the cdn is not available, it will use your local jQuery as a plan B.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2