Fork me on GitHub
Subscribe 4

Ticket #304 (fixed enhancement)

Add jQuery

  • Created: 2011-02-22 12:21:14
  • Reported by: Reines
  • Assigned to: Franz
  • Milestone: 2.0-alpha2
  • Component: javascript
  • Priority: normal

Make use of the jQuery library for various javascript effects, as well as providing it for any plugins which wish to use it.


Reines 2011-02-25 00:47:45

  • Milestone changed from 2.0-beta1 to 2.0-alpha2.

llaumgui 2011-03-09 13:07:25

Allow to get jQuery from a Google CDN cold be a good idea : … tml#jquery

Reines 2011-04-16 21:23:59

Might be worth considering handling this in a way similar to wordpress (wp_enqueue_script()).

Franz 2012-01-26 12:56:57

Hmm... isn't that a very theme-specific thing?

What I mean is that the easiest thing would probably be to let themes simply include jQuery (e.g. from Google's CDN) if they need it.

Reines 2012-01-26 14:46:18

I guess the issue is when an extension wants to use jQuery - should they rely on the theme having it available or load it themselves? Either way if they get it wrong it wont work - hence WordPress provide a method to load it only if it isn't already loaded.

This probably shouldn't be specific to jQuery - rather a function to loading any javascript-script, but only if it isn't already. See: wp_enqueue_script.

Franz 2012-01-26 15:03:51

So does that mean we would include jQuery with the core?

Reines 2012-01-26 15:35:37

Not necessarily, though we could if we wanted. For example we might have a load_script($alias, $path) function in the core that would require the path given - in which case it would be loaded from the path given by whatever called it first (theme/extension/whatever).

Alternatively we could include jquery in the core or even just the path to it on a CDN, and simply have a load_script($alias [, $path]) function, where the $path is optional, and an error is thrown if none is given and it isn't a known library.

SuperMAG 2012-12-01 11:12:15

this shouldnt be in the core, if you guys insist, make an option in admin area to enable it (with option to choose from which source, local, google, jquery site etc).

Franz 2013-01-18 13:48:03

  • Owner set to Franz.

Franz 2013-01-18 13:50:15

  • Status changed from open to fixed.

I added jQuery to the admin panel yesterday.

I will create a separate ticket for proper asset management - that will allow us to combine and compress these files, too. smile