Permalink
Browse files

use wp default jquery. See long comment

This solves 2 problems:
1st we was registering
jquery with the already registered by default
"jquery" handle. 2nd hardcoded jQuery version has
maintanability issues, while WP offers updated
and standard jquery itself.
2nd wp's dafault jquery is loaded in no-conflict
mode, so "$" is not a function by default. I've
modified application.js.coffee in order to have
$ setted up out of the box
  • Loading branch information...
1 parent eccf9e9 commit 1ef0a8b3ac671a1053c679f63ba55f16c66018b0 @pioneerskies pioneerskies committed Dec 17, 2013
@@ -12,10 +12,9 @@ function enqueue_stylesheets() {
// This function include jquery and application.js in wp_footer() function
function enqueue_javascripts() {
- wp_register_script("jquery", '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js', '', false, true);
wp_enqueue_script("jquery");
wp_register_script("application", javascript_url("application"), '', false, true);
wp_enqueue_script("application");
}
-add_action('wp_enqueue_scripts', 'enqueue_javascripts');
+add_action('wp_enqueue_scripts', 'enqueue_javascripts');
@@ -1,2 +1,2 @@
-$ ->
+jQuery ($) ->
"Yep, it works!"

0 comments on commit 1ef0a8b

Please sign in to comment.