Created
February 10, 2012 22:55
-
-
Save dalethedeveloper/1793789 to your computer and use it in GitHub Desktop.
Safely wrap jQuery when multiple versions are present on a page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
For testing how multiple versions of jQuery interact on a page, | |
see http://jsfiddle.net/dalesaurus/5TgkG/ | |
--> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript">window.jQuery || document.write('<script src="/js/jquery-1.7.1.min.js"><\/script>')</script></script> | |
<script type="text/javascript"> | |
var jQuery171 = window.jQuery; | |
jQuery171(document).ready(function($){ | |
// Do work, son! | |
})(jQuery171); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment