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

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 8 19:50:22 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:                      |
--------------------------------+------------------------------

Comment (by ericmann):

 Replying to [comment:2 filosofo]:
 > I think Lloyd's suggestion is a good one.  Working with theme designers,
 the most common JS error I see is related to their using jQuery plugins
 that assume `$` is the jQuery object even in global scope.

 I disagree entirely.  Any jQuery plugin that makes that assumption (that
 the global `$` is an alias for jQuery) isn't a properly written jQuery
 plugin.  Even the [http://docs.jquery.com/Plugins/Authoring most basic
 tutorials available from the jQuery team] start plugins with
 `jQuery.fn.myplugin = function() { ... }`.

 > And Prototype's been basically dead for years now.

 Prototype isn't the only library that uses `$`.  So does MooTools.  And
 there are plenty of plug-ins out there that depend on MooTools.

 > The problem with educating developers is that typically the assumption
 is upstream, both in the plugin libraries and in the web tutorials, and
 the people using them don't have the knowledge necessary to make the
 changes.

 The problem with educating developers is that no one bothers to educated
 developers.  We make the assumption that people won't learn and try to
 protect them from their own incompetence by making systems "idiot proof."

 jQuery is a well-known and widely-used library.  It's also well-written
 enough that you can turn off the `$` alias with a single line of code when
 you first start things out.  It's easy to remap `jQuery` to `$` as well if
 you need it, and most of your theme's script will need to fire on the
 page's ready event anyway ...


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

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


More information about the wp-trac mailing list