4 ms·
Basically it boils down to what you want to do. If you know you’re replacing many parts of your page with data you have to load, use a framework like angular,
by flying-sheep 13y ago
Basically it boils down to what you want to do.
If you know you’re replacing many parts of your page with data you have to load, use a framework like angular, backbone, ember, …
If you visualize data, use d3.
If you need to animate some UI elements but don’t need much else, use jQuery.
Else use plain JS, maybe with some shortcuts like
function $(sel) { return document.querySelector(sel) }. maybe with underscore.js if your love funtional programming.
In any case, strive to write idiomatic code. d3, jQuery, and many else e.g. have their own variant of $, select, querySelector, … – decide on one framework and use its way to write code.
Any you’ll want to find a way to compartimentalize code. https://github.com/mbostock/smash https://github.com/mbostock/smash is good, and http://browserify.org/ http://browserify.org/
- jrub 13y agobrowserify, +1.