Skip to main content
Commonmark migration
Source Link

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

#Related

Related

How Do I Use jQuery UI In My Plugin

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

#Related

How Do I Use jQuery UI In My Plugin

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

Related

How Do I Use jQuery UI In My Plugin

replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

#Related

How Do I Use jQuery UI In My PluginHow Do I Use jQuery UI In My Plugin

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

#Related

How Do I Use jQuery UI In My Plugin

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

#Related

How Do I Use jQuery UI In My Plugin

Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

WordPress loads jQuery in "No Conflict" mode. The $ alias does not work. This is the cause of most of the "jQuery doesn't work" questions on this site.

Your code is using that $ alias, despite the Codex warnings against doing so.

Use jQuery.(document) or wrap your code like...

(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);

You should also not be embedding the script into the template like that. Save yourself some headaches and register and enqueue your scripts properly. By doing that you can easily load scripts only where needed and make use of very good dependency juggling.

#Related

How Do I Use jQuery UI In My Plugin