Skip to content

Instantly share code, notes, and snippets.

@Angelfirenze
Created February 5, 2014 22:54
Show Gist options
  • Save Angelfirenze/8835043 to your computer and use it in GitHub Desktop.
Save Angelfirenze/8835043 to your computer and use it in GitHub Desktop.
/**
* $(document).ready()
**/
$(document).ready(function() {
// Handler for .ready() called.
});
$(function() {
// Handler for .ready() called.
});
jQuery(document).ready(function($) {
// Code using $ as usual goes here.
});
/**
* $.noConflict
**/
jQuery.noConflict();
jQuery("div p").hide(); // Do something with jQuery
$("content").style.display = "none"; // Do something with another library's $()
jQuery.noConflict(); (function($) { $(function() {
// More code using $ as alias to jQuery
});})(jQuery);
var j = jQuery.noConflict();
j( "div p" ).hide(); // Do something with jQuery
$( "content" ).style.display = "none";
var dom = {};
dom.query = jQuery.noConflict( true );
dom.query( "div p" ).hide(); // Do something with the new jQuery
$( "content" ).style.display = "none"; // Do something with another library's $()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment