List Info

Thread: $ in jQuery, Prototype and Mochikit




$ in jQuery, Prototype and Mochikit
country flaguser name
United States
2007-09-03 00:31:53
Hi, all

I blogged one case in my blog (http://jack.lifegoo.co
m/?p=163) which
described the "complaint" of $ in jQuery,
Prototype and Mochikit,
could you please take it consider and reduce the conflicts?

Thanks.

/Jack


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: $ in jQuery, Prototype and Mochikit
user name
2007-09-03 00:42:43
MochiKit doesn't actually use $, it's just an alias for
getElement
that we export for the user's convenience. You can load
whatever
library you want after MochiKit and let it take over use of
$, nothing
will break.

-bob

On 9/2/07, jack.tang <himarsgmail.com> wrote:
>
> Hi, all
>
> I blogged one case in my blog (http://jack.lifegoo.co
m/?p=163) which
> described the "complaint" of $ in jQuery,
Prototype and Mochikit,
> could you please take it consider and reduce the
conflicts?
>
> Thanks.
>
> /Jack
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: $ in jQuery, Prototype and Mochikit
country flaguser name
United States
2007-09-03 01:50:01
On Sep 3, 7:42 am, "Bob Ippolito" <b...redivi.com> wrote:
> MochiKit doesn't actually use $, it's just an alias for
getElement
> that we export for the user's convenience. You can load
whatever
> library you want after MochiKit and let it take over
use of $, nothing
> will break.
>
> -bob
>
> On 9/2/07, jack.tang <him...gmail.com> wrote:
>
>
>
> > Hi, all
>
> > I blogged one case in my blog (http://jack.lifegoo.co
m/?p=163) which
> > described the "complaint" of $ in
jQuery, Prototype and Mochikit,
> > could you please take it consider and reduce the
conflicts?
>
> > Thanks.
>
> > /Jack

We are using MochiKit and JQuery.

JQuery tells to use the 'jQuery.noConflict()' but we
continued to have
compatibility problems.

After investigation a little bit, I found a solution:

we first load MochiKit, then JQuery, and we add than little
code just
before the </head>

<script type="text/javascript">
  jQuery._$ = MochiKit.DOM.getElement;
  var $j = jQuery.noConflict();
</script>

$ refers to MochiKit's getElement
$j refers to JQuery's $

PS: I hope the html tags will render correctly (there is no
preview)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


$ in jQuery, Prototype and Mochikit
user name
2007-09-03 09:59:21
jQuery already has a .noConflict() method that completely
removes any
conflict with $.

You can find out more information here:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries


and here:
http://
docs.jquery.com/Core/jQuery.noConflict

--John

On 9/3/07, jack.tang <himarsgmail.com> wrote:
>
> Hi, all
>
> I blogged one case in my blog (http://jack.lifegoo.co
m/?p=163) which
> described the "complaint" of $ in jQuery,
Prototype and Mochikit,
> could you please take it consider and reduce the
conflicts?
>
> Thanks.
>
> /Jack
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )