Now the internet giants have provided some static resources public library for the vast number of developers to provide convenience;
Because they have CDN nodes all over the place, using these repositories can speed up loading resources and save traffic.
However, because there is a sacred wall of reason, I wait for the people living in the Celestial kingdom is not able to enjoy Google's resource pool;
But Baidu's resource pool is also very good; recommended try: http://cdn.code.baidu.com/
Here's an example of jquery:
<script type= "Text/javascript" src= "//apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js" ></script>< Script> (function () {window.jquery | | document.write (' <script src= '/public/static/js/jquery-2.0.0.min.js ' > <\/script> ');}) ();</script>
But, the world of the Internet is changing so fast, who can guarantee that Baidu will provide us with CDN service permanently?
So be on the safe side; we still need to put a jquery on our server, and then set the fallback address;
When Baidu's CDN is not available, use our own server's jquery resources;
Code as above;
This article for Bai Jun Remote original article, reprinted without contact with me, but please specify from Bai Jun remote blog http://www.baijunyao.com
Use jquery static resources Public Library CDN and fallback address