On 3 Mar 2009, at 14:39, Eric Shulman wrote:
> [snip]
> Starting with TW250b2, the main() function immediately
> invokes jQuery.noConflict(), right at the start. This prevents jQuery
> from re-defining the $(...) function, so that other definitions of $
> (...) (e.g., InlineJavascriptPlugin) will not be broken.
>
> In order to use jQuery functions without the $(...) idiom, simply
> substitute 'jQuery' for '$' in your code, like this:
> -----------------
> <script show>
> jQuery(document).ready(function( ) {
> jQuery('table.twtable tr:even').addClass('even');
> jQuery('table.twtable tbody tr').mouseover(function(){
> [snip]
There's a nice explanation of this issue on Simon Willison's blog:
http://simonwillison.net/2007/Aug/15/jquery/
where he suggest the following idiom when writing jQuery in a
noConflict environment:
-----------
(function($) {
// Within this block, $ is a reference to jQuery
// Neat, huh? })(jQuery);
-----------
Authors of plugins which provide a "$" function might like to take a
leaf out of jQuery's book and also provide a noConflict method and
alternative function.
Paul (psd)
--
http://blog.whatfettle.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---