[wp-hackers] ShareThis plugin breaks prototype.js Class object.
Sabin Iacob
iacobs at m0n5t3r.info
Wed Apr 16 08:35:37 GMT 2008
dubayou wrote:
> This was driving me crazy. I could access the 'Class' (that prototype
> built) If i put my java above the wp_head() call but the java in my
> plugin fails if I call
>
erm, did you say Java? omg! (sorry, I couldn't help it)
> ...
> var TabMonster = Class.create({
> initialize: function(tab_list_container,options){
> ...
> from within a hook to wp_head().
> So does lightbox or any plugin that relays on the Prototype framework
>
> So it turns out that teh ShareThis plugin brings in some java from
> w.sharethis.com that has its own Class def that over writes prototype.
> lame.
>
it is probably a different (older) version of prototype; had they used
the script loader, it would load the Wordpress-supplied prototype
library and ignore the rest, and wouldn't break everything else; but
then again, their plugin would not be guaranteed to work across
Wordpress versions
this is a complicated problem, actually, because few libraries can
accommodate several of their own versions running at the same time
(actually, the only one I know is jQuery), and there is not much you can
do, except for warning the users (or rewriting your javascripts for
jQuery ;)).
More information about the wp-hackers
mailing list