[wp-hackers] Adding an output buffer callback
scribu
scribu at gmail.com
Mon Nov 2 12:41:14 UTC 2009
>
> One of the most common support issues I have with my Shashin (Picasa photo
> viewer) plugin is conflicts with Google Analytics plugins, so at least some
> of them do in fact interfere with the output of other plugins. My plugin
> creates links with onclicks to enable the photo viewer, and at least some of
> the GA plugins blithely overwrite those onclicks with their own, breaking my
> plugin. Please keep this in mind when working on your plugin - check for an
> existing onclick before creating one. You can probably add your instructions
> to the end of an existing onclick, but please test it first.
>
That's a prime example for why un-obtrusive javascript is better:
Both plugins should attach onClick handlers using jQuery:
jQuery('a').click(yourEventHandler);
--
http://scribu.net
More information about the wp-hackers
mailing list