[wp-trac] [WordPress Trac] #16494: Remove "no conflict" mode from bundled jquery

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 29 17:14:25 UTC 2011


#16494: Remove "no conflict" mode from bundled jquery
--------------------------------+------------------------------
 Reporter:  lloydbudd           |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  low                 |   Milestone:  Awaiting Review
Component:  External Libraries  |     Version:  3.1
 Severity:  minor               |  Resolution:
 Keywords:  close               |
--------------------------------+------------------------------

Comment (by azaozz):

 Replying to [comment:25 aaroncampbell]:
 > ... my only counter point would be that we have a LOT of hook that a
 plugin can hook into and break WordPress or other plugins.

 True but all these hooks have legitimate uses where nothing is broken. If
 we add `noConflict()` to a hook the only purpose would seem to be for
 plugins to remove it.

 > 1. I see the best-case scenario (and least back-compat) as this: We
 remove no conflict and plugins can add it back if they use  prototype ,
 mootools, etc.
 > 2. The second best option I see is the ability of a plugin to remove
 it...

 If a plugin removes `noConflict()` and starts using $ for jQuery (in
 global scope), it would introduce an unresolvable conflict with
 Prototype.js, etc. There are several ways to wrap jQuery around the JS if
 needed:
 {{{
 jQuery(document).ready(function($){
 ...
 });

 (function($){
 ...
 })(jQuery);
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16494#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list