[wp-trac] Re: [WordPress Trac] #4988: Included jQuery library 1.1.4
may be defective
WordPress Trac
wp-trac at lists.automattic.com
Sun Sep 16 11:50:54 GMT 2007
#4988: Included jQuery library 1.1.4 may be defective
----------------------------+-----------------------------------------------
Reporter: ionfish | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.3
Component: Administration | Version: 2.3
Severity: normal | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by DD32):
>- not sure exactly what, given that I can't read a Gzipped JavaScript?
library -
You can replace the file with the uncompressed version for development if
you wish.
Since WP uses Prototype in places(Or at least still includes it) Prototype
gets the $ variable. (As it was included first, its backwards
compatibility)
To work around that, jQuery has allowed for a $.noConflict() mode which
jquery operates in with WP, when noConflict mode is enabled, jQuery no
longer uses the $ value, only the jQuery value. (ie. $.function() =
jQuery.function() )
Previously, when noConflict was enabled, $ would still stay assigned to
jQuery if nothing else was using it, in the latest however, when no
conflict is enabled, it seems that $ is no longer assigned. (It seems this
is to do with the "Any Name jQuery" function:
http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-
for-12/ )
Theres a work around for this too, allthough, i'm not sure of it, someone
else will hopefully be able to give the correct syntax, but from pure
memory its something like this:
{{{
jQuery( function($){
//Use $ here
});
}}}
Personally i've added this to the top of a few options pages for my
plugins:
{{{
$ = jQuery;
}}}
So, What i've been trying to say, is that its the noConflict() mode which
will be breaking your script.
Also, as a side note, The reason 1.2 isnt included in 2.3 is to keep the
same stable line, See #4952
and see #4977 for interface related issues with jQuery
D
--
Ticket URL: <http://trac.wordpress.org/ticket/4988#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list