Posted By

a1ias on 02/17/15


Tagged

jquery


Versions (?)

Check if jquery was loaded from CDN


 / Published in: JavaScript
 

URL: http://habrahabr.ru/post/250663/

Check if jquery was loaded from CDN. If not, load it from own website.

  1. <script>
  2. if(typeof window.jQuery === 'undefined') {
  3. document.write(
  4. unescape("%3Cscript src='js/jquery.js' type='text/javascript'%3E%3C/script%3E")
  5. );
  6. }
  7. </script>

Report this snippet  

You need to login to post a comment.