Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the exact console message, then check which jQuery file loaded, when it loaded, and whether the page uses the full or slim build. Those details distinguish a missing script from a name conflict, a build omission, a ready-timing problem, or an incompatible plugin.

Diagnose the page before changing code

The same error text can have different causes. Work through these checks in order and keep the complete console message and line number; the failing line may be in a plugin or bundled script rather than your own code.

  1. Check the script request. In browser DevTools, open the Network panel, reload the page, and confirm the jQuery request succeeded. In the page source or Elements panel, check that the jQuery script appears before scripts that use it.
  2. Inspect the globals. In the Console, evaluate window.jQuery and window.$. If either is undefined, the library may not have loaded, a custom build may have removed its globals, or another script may have changed the global names.
  3. Identify the version and build. Evaluate jQuery.fn.jquery if jQuery exists. Check the script URL and project configuration for a slim or custom build; these may omit features available in the full distribution.
  4. Check the code’s timing and targets. For DOM-dependent initialization, use $(function () { /* initialize */ }); and confirm the selectors match elements that exist when the callback runs.
  5. Check conflicts, duplicates, and plugins. Determine whether another library uses $, whether multiple jQuery versions load, and whether the plugin script loads after the intended jQuery instance. Verify plugin compatibility in that plugin’s own documentation.

Match the error to its likely cause

Console message or symptom Likely cause to check Useful fix
$ is not defined or jQuery is not defined jQuery failed to load, loaded after dependent code, or a custom build excluded global names. Fix the script request or order. If using a custom build, check whether it excludes the exports/global option that exposes global $ and jQuery.
$ is not a function $ refers to another library or was reassigned; a conflicting or duplicate jQuery instance is also possible. Use jQuery’s no-conflict mode and a dedicated alias, or use the jQuery name inside a callback.
$(...).ready is not a function or a ready handler does not run Legacy ready-event binding, incorrect timing assumptions, or code running against something other than the expected jQuery object. Use $(handler). Do not use .on("ready"); that event binding was removed in jQuery 3.0.
$.ajax is not a function The page may use the slim build or a custom build that excludes Ajax. Use the full build if the page needs Ajax, or otherwise provide the needed Ajax functionality separately.
An animation method is missing The slim or custom build may exclude effects. Use the full build if the page depends on jQuery effects.
$(...).widget is not a function or another plugin method is missing The plugin may not have loaded, may have loaded before jQuery, may target a different jQuery instance, or may not support the installed major version. Check script order and the active jQuery instance, then confirm version support in the plugin documentation.

Fix loading and global-name problems

When $ or jQuery is undefined

First confirm the browser received the jQuery file successfully and that it executes before dependent code. A script tag that comes later in the document cannot satisfy code that ran earlier. If the page uses a custom build, check whether its configuration excludes global exports; the official jQuery repository documents an exports/global exclusion that removes global $ and jQuery.

Do not treat a ready callback as a repair for a missing library. $(function () { ... }) can defer initialization until the DOM is ready only after jQuery itself is available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

When another library owns $

$ is an alias, not a name guaranteed to belong to jQuery. If another library uses it, call jQuery.noConflict() and use a separate variable. The jQuery Learning Center’s conflict guidance, last updated August 10, 2026, describes this approach: Avoiding Conflicts with Other Libraries.

var jq = jQuery.noConflict();
jq(function () {
  jq(".message").addClass("ready");
});

You can also pass jQuery into a ready callback, keeping the code’s use of $ local to that callback:

Rank #2
Sale
JavaScript and jQuery: Interactive Front-End Web Development
  • JavaScript Jquery
  • Introduces core programming concepts in JavaScript and jQuery
  • Uses clear descriptions, inspiring examples, and easy-to-follow diagrams
jQuery(function ($) {
  $(".message").addClass("ready");
});

When two jQuery versions are present

Loading two versions is discouraged because plugins and application code can end up attached to different instances. Check which version loads first and which one the plugin expects before changing globals. The API documentation says that, if two versions are loaded, calling $.noConflict(true) from the second restores the globally scoped jQuery variables to those of the first; use it only when that arrangement is intentional and understood: jQuery.noConflict().

Fix ready and DOM timing issues

For new code, use $(handler) (or jQuery(handler)) to run initialization after the DOM is ready:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$(function () {
  $("#save").on("click", function () {
    // Handle the click.
  });
});

The jQuery API documentation recommends this form as of jQuery 3.0; other ready syntaxes still work but are deprecated. It also notes that jQuery 3.0 and later invoke ready callbacks asynchronously, so code should not depend on the callback running immediately when the DOM is already ready: .ready().

If a click handler does not work, verify that the selector matches an element and that the handler is attached after the relevant code and jQuery have loaded. If the target is added to the page later, attach a delegated handler to an ancestor that is already present:

$(function () {
  $(document).on("click", ".dynamic-button", function () {
    // Handle clicks on matching buttons added later.
  });
});
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check whether the build includes the method

The official slim build excludes Ajax and effects modules. That means $.ajax or an animation method may be missing even though selectors and basic jQuery methods work. The jQuery Download page describes the slim build as a smaller version that excludes Ajax and effects: Download jQuery.

If the page needs those modules, switch to the full build. If it uses a custom build, inspect the build configuration for excluded modules before rewriting code or blaming the selector.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Update legacy event methods safely

Older code may emit migration warnings for event shorthand methods such as .bind(), .delegate(), .live(), .load(), .unload(), or .error(). Replace deprecated event APIs with .on() and .off() according to the jQuery upgrade guidance. For example, a direct binding can be written as:

// Older style
$("#save").bind("click", handler);

// Current event API
$("#save").on("click", handler);

During an upgrade, jQuery Migrate can report compatibility warnings that help locate legacy behavior. Resolve the warnings and address the applicable breaking changes, then remove Migrate rather than treating it as a permanent substitute for updating the code. Consult the version-specific upgrade guidance and Migrate documentation: jQuery Core Upgrade Guides and jQuery Migrate.

Why the version and build matter

Before choosing a fix, distinguish the issue along these axes:

Quick Recap

SaleBestseller No. 1
Web Design with HTML, CSS, JavaScript and jQuery Set
Web Design with HTML, CSS, JavaScript and jQuery Set
Brand: Wiley; Set of 2 Volumes
$35.05
SaleBestseller No. 2
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript Jquery; Introduces core programming concepts in JavaScript and jQuery; Uses clear descriptions, inspiring examples, and easy-to-follow diagrams
$22.80
  • Version: Ready-event behavior and deprecated APIs vary across jQuery releases; identify the installed version rather than assuming legacy code still works.
  • Build: Full, slim, and custom builds do not necessarily contain the same modules or globals.
  • Load order and duplicates: Dependent code and plugins must run against the intended jQuery instance.
  • Namespace: Another library may own $, even when jQuery is available under jQuery.
  • DOM timing: A correct handler cannot act on an element that does not yet exist in the DOM.
  • Plugin support: A plugin method can be absent because the plugin failed to load or does not support the installed jQuery major version.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.