Response title
This is preview!




Referencing Magic - Shortcuts for jQuery
If you don't like typing the full "jQuery" all the time, there are some alternative shortcuts:
* Reassign jQuery to another shortcut
o var $j = jQuery;
o (This might be the best approach if you wish to use different libraries) ccnp
* Use the following technique, which allows you to use $ inside of a block of code without permanently overwriting $:
o (function($) { /* some code that uses $ */ })(jQuery)
o Note: If you use this technique, you will not be able to use Prototype methods inside this capsuled function that expect $ to be Prototype's $, so you're making a choice to use only jQuery in that block.
* Use the argument to the jQuery(document).ready(function($) {})
DOM ready event:
*
o jQuery(function($) { /* some code that uses $ */ });
o Note: Again, inside that block you can't use Prototype methods.
However if I want to load it using jquery I'm having no luck.
© 2012 jQuery Foundation
Sponsored by
and others.
