views:

153

answers:

2

Is there any online utility to convert jquery syntax to mootools syntax?
Is there any guideline to convert jquery to mootools?

+4  A: 

I've not seen one, no.

But I would argue that even if one did exist, it probably wouldn't be that good. It's hard to convey the meaning of code when you're dealing with such a poetic language as JavaScript; there are just too many ways of doing similar things.

Worse still is that you can't map MT to JQ directly. They have slightly different feature-sets and each would rely on extra things being implemented.

I think you'd get a much cleaner, massively more maintainable result transcoding it yourself. It's a good opportunity to improve on the original too, which can't be a bad thing.

Oli
+1  A: 

although there are no guidelines that I know of, I'd start by glancing over at these:

http://www.jqueryvsmootools.com - same things being done under both frameworks side by side, by aaron newton and comment contribs

http://www.davidwaslh.name - mootools core team dev that also works a lot with jquery and often releases tips on interchangeable code between the two frameworks, he even has a plugin that enables jquery syntax for mootools - i know it's the reverse of what you want but it's a start--i think he coded it to demo of how flexible mootools is and make it more appealing to jquery users that want to go further but it's quite useful.

mixing the two frameworks seems quite popular, even today i saw this on twitter: http://jsfiddle.net/fate/jGhpc/ (mootools "style" Classes in jquery)

or ryan florence's ACTUAL implementation of the mootools OOP model inside of jquery: http://ryanflorence.com/object-oriented-jquery-with-mootools-pigs-take-flight/

bottom line is, you will need to do some work but it's a good thing, will really give you a perspective on which framework is better suited to you.

Dimitar Christoff