The newest version of MooTools has a no conflict mode. Unfortunately, Prototype does not, which means that the $
will have to be bound to Prototype.
To enable the Dollar Safe Mode, upgrade your version of MooTools and make sure you include MooTools after Prototype.
<script type="text/javascript" src="prototype.js" />
<script type="text/javascript" src="mootools.js" />
After doing so, $
will be bound to Prototype. In MooTools scripts, replace all $
references to document.id
.
// Before
var X = new Class({
initialize: function(element){
this.element = $(element);
}
});
// After
var X = new Class({
initialize: function(element){
this.element = document.id(element);
}
});
or you can use a closure:
(function(){
var $ = document.id;
this.X = new Class({
initialize: function(element){
this.element = $(element);
}
});
})();
More information about the Dollar Safe Mode is available in MooTools' blog:
http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/