Just exploring an idea here. I know its been brought up before and shot down
but I it doesn't hurt to try ;)

The only thing I am trying to achieve with this concept is to remove the
dependency on $().

When you attach mootools to a page what if a query string was added

<script id="mootools" type="text/javascript"
src="mootools.js?compatibility=true"></script>

The only cravat is a standard id would need to be established for the
mootools script to find its own query string. The other option would be
something like this:

<script type="text/javascript">Mootools_Compatibility = true;</script>
<script type="text/javascript" src="mootools.js"></script>

By default the core Mootools internally would be changed to replace $() with
$m().

If compatibility mode is off $m() is copied to $() globally.

Window.alias('$m', '$');

If compatibility mode is on, a closure is created around Native or Class to
expose $m() as $().

In the standard download I count 22 places where $() is used. If this
closure method is used, I believe only the domready code would need to
implement $m() instead of $().

Using this method all Classes regardless of using $() or $m() would work.

I believe this would solve a large majority of the compatibility issues
Mootools has with other frameworks.

Reply via email to