jQuery & jQuery UI from Google CDN w/ Fallback to Local


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. if (typeof jQuery == 'undefined'){
  4. document.write('<script src="<?php bloginfo( 'template_directory' ); ?>/js/libs/jquery-1.6.2.min.js"><\/script>');
  5. }
  6. </script>
  7. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>
  8. <script type="text/javascript">
  9. if (typeof jQuery.ui == 'undefined') {
  10. document.write('<script src="<?php bloginfo( 'template_directory' ); ?>/js/libs/jquery-ui-1.8.15.min.js"><\/script>');
  11. }
  12. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.