Skip to content

Instantly share code, notes, and snippets.

@lionhylra
Created September 17, 2013 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lionhylra/6590082 to your computer and use it in GitHub Desktop.
Save lionhylra/6590082 to your computer and use it in GitHub Desktop.
$.noConflict();
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.
jQuery.noConflict();
(function( $ ) {
$(function() {
// More code using $ as alias to jQuery
});
})(jQuery);
// Other code using $ as an alias to the other library
var j = jQuery.noConflict();
// Do something with jQuery
j( "div p" ).hide();
// Do something with another library's $()
$( "content" ).style.display = "none";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment