Link Details

Link 40384 thumbnail
User 111696 avatar

By bloid
via studio-cdd.com:8080
Published: Sep 10 2007 / 07:52

Recently I started the quest for a new JavaScript framework. I've been using Prototype along with Scriptaculous and many other libraries I coded for myself for a while, but I'm getting tired of the lack of more advanced plugins like sortable table, data grids or just a calendar.
  • 11
  • 1
  • 1661
  • 642

Comments

Add your comment
User 206689 avatar

jeresig replied ago:

0 votes Vote down Vote up Reply

There's a weird mistake in the tests - he uses .hide(0) (which starts an animation) instead of doing .hide() (which just, simply, hides an element). Fixing this would dramatically decrease the amount of time that particular test takes.

User 230127 avatar

kangax replied ago:

0 votes Vote down Vote up Reply

Besides what John mentioned, prototype has a convenient, specifically optimized (!!!) invoke method, so instead of:

$$('td').each(function(el){
Event.observe(el, 'click', function(){
alert('Hello world!');
})
});

one could simply do:

$$('td').invoke('observe', 'click', function(){ alert('Hello world!') });

As far as insertion, instead of:

$$('li').each(function(el){
new Insertion.After(el, 'yay') ;
});

one could do:

$$('li').invoke('insert', {after: 'yay'}); // btw, do we still use "b" tag?

I thought my prototype-checklist got enough exposure not to make such mistakes...

I admire author's time and effort but these tests are hardly relevant.
Voted down

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (11)



Voters Against This Link (1)