Prototype.js reviewed
I spend the last days (including the weekend) in getting into prototype.js by Sam Stephenson.
Here is a quick guide.
And it made my head ache. The problem with javascript is that there are soooo many ways to achieve something.
The part i like the most on prototype.js is that it's divided in smaller packages which allows you to take out what you need. But at some points it's trying to do too much. I can't see the advantage of introducing another bunch of new concepts to javascript (enumerations) just because it's cool and you can do it. It blows up the size of the lib and it BREAKS the Array object. (for (var i in arr) ...). So using prototype.js in the same page with other Javascript libs will break for sure.
There are two subprojects that caught my interest. script.aculo.us and behaviour.
script.aculo.us because it was written by an austrian and has a very cool DragAndDrop implementation.
And behaviour because it provides a real cool function:
element accepts style selectors, and returns an Array of elements. [originally developed by Simon Willison]
If you patch this function with:
For those who just need a small part of all that might also want to take a look at:moofx
Here is a quick guide.
And it made my head ache. The problem with javascript is that there are soooo many ways to achieve something.
The part i like the most on prototype.js is that it's divided in smaller packages which allows you to take out what you need. But at some points it's trying to do too much. I can't see the advantage of introducing another bunch of new concepts to javascript (enumerations) just because it's cool and you can do it. It blows up the size of the lib and it BREAKS the Array object. (for (var i in arr) ...). So using prototype.js in the same page with other Javascript libs will break for sure.
There are two subprojects that caught my interest. script.aculo.us and behaviour.
script.aculo.us because it was written by an austrian and has a very cool DragAndDrop implementation.
And behaviour because it provides a real cool function:
document.getElementsBySelector(element).element accepts style selectors, and returns an Array of elements. [originally developed by Simon Willison]
If you patch this function with:
document.getElementsBySelector = function(selector, parentElement) {
..
var currentContext = (parentElement) ? new Array($(parentElement)) : new Array(document);
...
you get a very powerful node selector.For those who just need a small part of all that might also want to take a look at:moofx
matthias - 12. Dec, 15:18








