Skip to content

Instantly share code, notes, and snippets.

@Xordal
Created January 15, 2014 05:45
Show Gist options
  • Save Xordal/8431409 to your computer and use it in GitHub Desktop.
Save Xordal/8431409 to your computer and use it in GitHub Desktop.
Multiple versions of jQuery on the same page
<script type='text/javascript' src='@Url.Content( "~/Scripts/jquery-1.5.1.js" )'></script>
<script type="text/javascript">
$(selector).dosome(); // for use 1.5.1 jquery
</script>
<!-- if we have layout with some jquery version -->
<script type="text/javascript" src='@Url.Content( "~/Scripts/jquery-1.6.4.js" )'></script>
<script type="text/javascript">
// create this naming for Jquery 1.6.4 version
var $j6 = $.noConflict(true);
// for use 1.6.4 jquery:
$j6(selector).dosome();
// for use default jquery version (1.5.1)
$(selector).dosome();
</script>
<!-- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -->
<!-- we can include other version jquery after 1.6.4 (if we haven't layout) -->
<script type="text/javascript" src='@Url.Content( "~/Scripts/jquery-1.6.4.js" )'></script>
<script type="text/javascript">
// create this naming for Jquery 1.6.4 version
var $j6 = $.noConflict(true);
</script>
<script type='text/javascript' src='@Url.Content( "~/Scripts/jquery-1.5.1.js" )'></script>
<script type="text/javascript">
// for use 1.6.4 jquery:
$j6(selector).dosome();
// for use default jquery version (1.5.1)
$(selector).dosome();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment