[wp-trac] [WordPress Trac] #16494: Remove "no conflict" mode from bundled jquery
WordPress Trac
wp-trac at lists.automattic.com
Thu May 12 17:37:55 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 jczorkmid):
I think removing `noConflict` at this point would be problematic, but I
would like to see it 'unbundled' from jQuery file itself. Early versions
of my 'Use Google Libraries' plugin (which changes the registered scripts
to same version hosted by the the Google CDN) used to enqueue a an
additional file with `jQuery.noConfict()` in it, but 90% of my support
requests were to avoid loading an additional script (but since my goal was
to remain 100% compatible with stock WordPress I couldn't just drop it).
In the end [https://plugins.trac.wordpress.org/browser/use-google-
libraries/trunk/use-google-libraries.php?rev=328729#L298 I used the
`script_loader_src` hook] to inject a script tag with
{{{
try{jQuery.noConflict();}catch(e){};
}}}
before the next enqueued script is rendered to the page.
I'd love to see a hook similar to what's available via
`wp_localize_script` but which allows a simple way to inject some inline
javascript directly **after** a script loads. Then, if the
`jQuery.noConflict()` was injected this way it would be possible to use an
unmodified `jquery.js` and still have it run in `noConflict` by default.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16494#comment:20>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list