There was a recent flurry of emails on the list discussing a conflict with the use of MooTools in conjunction with jQuery. When MooTools released v1.1, they renamed their events expando to $events, thus conflicting instantly with jQuery.

Well, Brazilian developer Alexandre Magno (http://blog.alexandremagno.net/) came up with a novel and quite simple solution to get around this issue; rename the $event expando in Mootools!

"I found a solution that works perfectly. Im the live example that we need sometimes to use the both frameworks. Im develop all my projects in jQuery, cause I learn more easily and feel more comfotable with it. Nothing to do with Mootools, with is a beatiful framework too... But I need the fancy upload to work and is just possible with Mootools, I make everything, but doesnt work because the conflict with the variable $event. I solve this issue by getting the mootools download with no compression, use a software like aptana, dreamweaver, or even notepad to replace all ocurrences of $event to $event2 for example, and compress the libraty after it. This way, the two frameworks works perfectly, since the use of jquery with noConflit its configured. I hope this works and soon I will develop this fancy upload for jquery to dont have to use both. Its a shame for the mootools team wait to Jquery solve this problem that noboby its blame... its just convention... why just simple replace $event for $mootoolsEvent or $mooEvent for example??? Somethimes its necessary use both, no doubt..""

This was posted in the MooTools forum in response to a post where John & I were trying to resolve an integration problem for a MooTools user who wanted to use MooTools and jQuery together. We realize that its unrealistic to expect that developers are going to use just one library and the team goes to great lengths to ensure some level of interoperability between other libraries via noConflict(). In jQuery v1.2, we take that a step further by allowing the renaming of the events expando to whatever you would like, thus avoiding any conflict.

While this was not a bug in jQuery, we feel strongly about allowing developers to leverage the tools that they need to do their work and we never want jQuery to be a bottleneck.

Thank you John & the jQuery team for continuing to make jQuery such a flexible solution and thank you Alexandre for expanding jQuery's reach to Brazil and offering up this great workaround.

Rey...

Reply via email to