elxsy where humanity wins the fight against machines


22
Jun/09
0

Javascript cross library programming

Javascript were generally used amateourly to provide animation effects before web 2.0 attack and xmlhttprequest api. Nowadays many open source libraries are published in order to write less and do much much more.  Jquery, Prototype, Mootols, Dojo, Ext are some of the popular ones.  So why we love them, just to write less? Noo, mostly they have powerful selectors.  As usual first internet explorer then Safari do not obey the language rules and change them in their personal favor. These libraries mostly eliminate the cross platform issues also.  Finally, they all wait for the document to be ready in order to be fire an event. Thus eliminates all weird AJAX and DOM actions that is dependent on DOM content. They added fancy effects to old boring text content! That is why we love and can not do without them now.

But they have created another problem. Lets say you are publishing some class, web software, plugin for some CMS. You may use one of these libraries but the target client may use another one or not use at all.  Furthermore this libraries are version dependant. Updates in the library may require you to update your software also. Making your software dependent on one of them decreases the product compatibility. They all have different APIs and structures no way to globalize them under a roof.  So what should you do? Make your software compatible with all of them.