premii / hn

Hacker News mobile app
MIT License
264 stars 37 forks source link

Clicking on comment toggles children #3

Closed mpxc8102 closed 8 years ago

mpxc8102 commented 10 years ago

I think it's very intuitive when clicking on a comment all of its threaded comments hide as well, so I've implemented this.

How would this be implemented in pure JavaScript?– because I notice the code is written mostly without jQuery. What benefit would there be to use the functions built into JavaScript over jQuery?

adrianlee commented 10 years ago

Working with the DOM directly in some cases can be a lot faster instead of with a library. I guess he wanted this app to be as fast as possible in terms of rendering and perf... hence his adoption of zepto over jquery. Once you're in the mobile space, using heavy dom libraries and js frameworks isn't the most ideal.

adrianlee commented 10 years ago

Check this out. http://jsperf.com/innertext-vs-fragment/20