[wp-hackers] AJAX / JS libraries

Andy Skelton skeltoac at gmail.com
Sun Apr 23 20:55:56 GMT 2006


On 4/23/06, Ryan Scheuermann <ryan at concept64.com> wrote:
> Personally, I recommend Prototype.  http://prototype.conio.net/  It's
> being used by the Widgets plugin and all the major applications running
> Ruby on Rails (see any 37 Signals product), and I don't think it's
> support is going to go away anytime soon.  And if you've ever seen
> anything written using it, the JS code is beautiful and simple and it
> works.

Why thank you! You're really too kind ;-)

Yeah, I'd love to start using Prototype and Scriptaculous in more
places in the admin and even have it available to themes. Getting rid
of Sack would be great.

We ought to have a set of core PHP functions to handle javascript
includes. Sort of like a wrapper for
add_action(is_admin()?'admin_head':'wp_head', $callback) where
$callback cannot be registered twice and known dependencies can be
handled (e.g. if Scriptaculous, include Prototype).

Another possibility is to write a gzip compressor that concatenates
all of the requested js libraries and compresses them. This would
reduce bandwidth in most cases.
script src="wp-includes/js/wp_js.php?prototype+scriptaculous"

Caveat: each combination of libraries would be downloaded and cached
without regard for the desired script already having been downloaded
in another combination.

Anybody interested in doing this for 2.1?

Andy


More information about the wp-hackers mailing list