Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

jQuery is fast, lightweight and easy to master.

For more advanced stuff, your best bet is Prototype.

Dojo, YUI (and ExtJS, not on your list) are good if you have a massive team of JavaScript developers and need standards and solid documentation, but are overkill for 90% of projects.



I've done ExtJS and jQuery for the same project recently.

Ext has a nice DataStore object for accessing remote data. And Ext has all those great "rich" components. But I found it wasn't much more work to do my own components in jQuery. (Tree is very simple to implement in jQuery from scratch)

The sense of control I have with jQuery is nice.

The main code to handle my own trees:

  _.fn.toggleTreeNode = function(animate) {
    var node = this.filter('button');
    if(animate) {
      node.siblings('ol').slideToggle(animate)
    }
    else { 
      node.siblings('ol').toggle();
    }
    node.parent().toggleClass('closed');
  };
You can see here the implementation is customized to the markup I needed for MY tree. CSS handles the rest, as it should.

My favorite thing about jQuery is it makes doing things the right way very easy.


Out of interest, why would you suggest Prototype for "more advanced stuff"?


Prototype has class-creation helpers galore, whereas jQuery expects you to do things the old-fashioned way.

There's a lot of jQuery love and Prototype hate out there, which I don't quite get. Both are fantastic; both are bloated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: