While Jquery offers a noConflict method some plugins don't support it. In
addition if you want to to inject Mootools into a page after Jquery you
can't. Think GreaseMonkey.
On Wed, Oct 15, 2008 at 11:24 AM, Bryan Swift <[EMAIL PROTECTED]>wrote:
> is there a reason you can't use jQuery's noConflict method?
>
> I guess I'm wondering why you're trying to namespace parts of MooTools when
> jQuery already has the built-in ability to restore the $ function to
> whatever it was before (or free it up if it was empty) via
> jQuery.noConflict()
>
>
> On Tue, Oct 14, 2008 at 9:33 AM, Tom Occhino <[EMAIL PROTECTED]> wrote:
>
>> it would be done like this...
>>
>> var MT = (function(){ // all of MooTools
>> // return some object containing MooTools functionality
>> })();
>>
>> This is basically what Yahoo does everywhere, and the whole premise behind
>> jQuery, a single object in the global namespace. Again though, that "all of
>> MooTools" line wont exactly work, because we use our global collections and
>> native prototypes throughout. Anywhere you see a MooTools method on an
>> Array, String, Number, etc would have to be changed to use generic functions
>> instead, so this kind of defeats the purpose of an Object-oriented coding
>> style...
>>
>>
>> On Oct 14, 2008, at 2:35 AM, nutron wrote:
>>
>> My 2 cents here:
>> 1) Everything Tom said and everything Nate said, I agree with. You
>> shouldn't run two frameworks. MooTools isn't trying to be compatible. Yada
>> yada. Prototype frameworks can't play nice no matter what, etc.
>>
>> 2) That said, academically I think there's an easy way to do this:
>> closure.
>>
>> (function(){
>> //ALL OF MOOTOOLS
>> //ALL YOUR CODE
>> })();
>>
>> It's not the same thing as having a version of MooTools that plays nice,
>> but it would work.
>>
>> You could allow methods to "escape" the closure, but this would be more
>> tricky:
>>
>>
>> var MT = {};
>>
>> (function(){
>> //ALL OF MOOTOOLS
>> MT.$ = $;
>> MT.$type = $type;
>> MT.Drag = Drag;
>> etc.
>> })();
>> MT.$('foo');
>>
>> Yes, methods like $ need $type, but those are available to $ via closure.
>> This would work, no?
>>
>>
>> On Mon, Oct 13, 2008 at 9:36 PM, nwhite <[EMAIL
>> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1331764&i=0>
>> > wrote:
>>
>>> Tom,
>>>
>>> I realize anything using the prototype chain is doomed to this fate.
>>> While it would be next to impossible to create a compatibility mode between
>>> Mootools & Prototype it would however be theoretically possible to do so
>>> with a namespaced framework.
>>>
>>> I guess I need to clarify my goals and expectations. I apologize for the
>>> title of the post, its has an element of sensationalism ;-) I never expected
>>> nor thought it was worth pursuing a compatibility level that would recreate
>>> another frameworks API with mootools. Nor was it my goal or focus to even
>>> worry or deal with other prototype based frameworks. My goal was to try and
>>> make Mootools peacefully coexist with other namespaced frameworks,
>>> particularly JQuery.
>>>
>>> I use Mootools on a daily basis and I am aware of all the complexities
>>> you pointed out. At the same time I have been required to be familiar with
>>> JQuery. I believe it was Jan that said earlier "that it is not an optimal
>>> solution to have two frameworks coexisting". The extra overhead, the
>>> duplication etc all take away the advantages. I do my absolute best to avoid
>>> even finding myself in a situation where this might happen. I also feel that
>>> if such a solution existed it should not be supported by Mootools as the
>>> levels of technical issues multiply. It is best to have someone leave and
>>> focus on a single framework. Rather then getting tied up in knots with two
>>> frameworks and javascript. So far I hope were on the same page ;-)
>>>
>>> I brought this up because I have had experience making JQuery and
>>> Mootools code running in the same page. Its not pretty but it is possible. I
>>> apologize for bring this into open discussion as it will only result in
>>> headaches. With the "holiday" I had too much time to ponder the post about
>>> Wordpress plugins using Mootools while facing the Jquery dependency. I love
>>> Mootools, I hate touching anything else and I thank you and the rest of the
>>> team daily as you make my day of coding that much easier and enjoyable.
>>>
>>> I will try and refrain from such radical hypothesis testing in the
>>> future.
>>>
>>>
>>> Nathan
>>>
>>> On Mon, Oct 13, 2008 at 11:42 PM, Iván N Paz <[EMAIL
>>> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1331579&i=0>
>>> > wrote:
>>>
>>>> 1 "?" wouldn't convey my concern/intrigue on this :-P
>>>>
>>>> > ps: @Iván, one question mark (?) is enough!
>>>>
>>>
>>>
>> The MooTools Tutorial: www.mootorial.com CNET Clientside:
>> clientside.cnet.com
>>
>> ------------------------------
>> View this message in context: Re: Mootools compatibility
>> mode<http://n2.nabble.com/Mootools-compatibility-mode-tp1330747p1331764.html>
>> Sent from the MooTools Users mailing list
>> archive<http://n2.nabble.com/MooTools-Users-f660466.html>at Nabble.com.
>>
>>
>>
>