I just switched the way my wordpress theme loads jQuery from manually loading google’s version to enqueuing the version that comes with wordpress. The version that comes with wordpress has “noconflict()” in it so the $ shortcut no longer works in all my jQuery and instead I need to use “jQuery” in it’s place.
I have a lot of .js scripts and a lot of jquery setting initializations on pages and now none of it works because it was all using the shorthand $.
My question is, assuming I NEED to use the noconflict version that comes with wordpress, what is the best way to fix my shorthand code?
Should I add a line like this to the top of each script?
jQuery(document).ready(function($) {
or should I “Find in files” all $ and replace with jQuery?
WordPress recommendation: a good read http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers
http://api.jquery.com/jQuery.noConflict/
code