Posted By

apphp-snippets on 08/20/13


Tagged

jquery loading fallback


Versions (?)

jQuery Loading Fallback


 / Published in: JavaScript
 

URL: http://www.apphp.com/index.php?snippet=html-jquery-loading-fallback

Nowadays majority of sites uses the jQuery JavaScript library. A lot of them also make use of Google's hosted version of the library from some reasons: faster loading, better cross site caching etc. However, what if there is ever a problem and jQuery is not loaded from Google? For example when you work on localhost and there is no Internet connection? This simple snippet will help you. It basically checks if jQuery is loaded from Google. If not, then it loads it locally from our own version of jQuery.

  1. Nowadays majority of sites uses the jQuery JavaScript library. A lot of them also make use of Google's hosted version of the library from some reasons: faster loading, better cross site caching etc. However, what if there is ever a problem and jQuery is not loaded from Google? For example when you work on localhost and there is no Internet connection? This simple snippet will help you. It basically checks if jQuery is loaded from Google. If not, then it loads it locally from our own version of jQuery.

Report this snippet  

You need to login to post a comment.