Javascript included but alert() function not working

A few things:

  1. The version of jQuery that ships with WordPress is run in noConflict() mode. Meaning you have to use jQuery instead of $ when you make your first reference.
  2. Don’t register your own version of jQuery when you’re developing. You’re locking yourself in to a single version that may or may not be compatible with WordPress’ other requirements.
  3. You can use the browser console to test things. Open your page, then hit F12 to launch the console. Type jQuery into the console and see whether or not it returns the correct object.

Leave a Comment