I would like to sue some JQuery functionality. I also had some JQuery plugins in use (JQuery Lazy Load, Slimbox2).
When adding my custom JS files, non-WP-plugin JQuery plugin files, and JQuery code files to my header, all is loaded properly (according to firebug).
BUT: e.g. the simple standard code
throws a Firebug error stating that “$ is not a function”. When I do
wp_deregister_script( 'jquery' ); wp_enqueue_script( 'jquery', get_bloginfo('template_url')."/js/jquery-1.4.2.min.js", array());
all seems to work fine. But I am afraid I might break something like this…
My questions are:
1. How to best reuse scripts from WP? I know the
wp_enqueue_script( 'jquery_scrollto', "/js/jquery.scrollTo.js", array('jquery'));
method, but even that did not work 100% and the error remained. Only when deregistering the standard jquery.js and re-regitering a custom jquery.1.4.2.js it worked. Why?
2. How to best queue scripts in the proper order?
3. When to place cusom script files that e.g. contain Jquery statements?
4. Is there a way to avoid plugins adding already added code? E.g. the Jqery library? Lazy load added a Google variant…
THANKS for any ideas and help. I would love to have some bright minds discuss with me that topic.
- The topic ‘JQuery: Several plugins and custom scripts’ is closed to new replies.