Hi all,

I just found a very annoying "feature" of the Prototype library on which the nice Scriptaculous Ajax stuff is buit. It adds a number of methods to the Array class to bring more features such as filtering, mapping, iterating, etc.

Sounds nice at first, but this has the effect of breaking JS code that iterates on arrays using "for (var i in array_var)", since all additional methods are now added to the iteration list with the array indices.

This broke htmlarea which I fixed by replacing the above syntax with the more java-ish "for (var i = 0; i < array_var.length; i++).

I consider this modification of the well known-contract of a native JS type a very bad thing, and this makes me consider to possibly use something else than Scriptaculous. I also raised this issue on their mailing list ([1] and follow-ups).

A good other candidate is Dojo [2] (no relation with Berin's container) which is growing fast, is the work of a team rather than a man, and has a cleaner and more documented code.

Other possible candidates you are aware of ?

Sylvain

[1] http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005-October/001049.html
[2] http://dojotoolkit.org/

--
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director

Reply via email to