forEach can be assumed so the framework is leaner, critical for building mobile apps.
zepto.js is under heavy development (growing by 2x since we first spotted it yesterday), but looks to deliver on its goal of being a “~2k library that handles most basic dredge work for you in a nice API so you can concentrate on getting stuff done.”
zepto.js uses the familiar
$ function and includes the usual suspects:
get(): return array of all elements found get(0): return first element found html('new html'): set the contents of the element(s) css('css properties'): set styles of the element(s) append, prepend: like html, but append or prepend to element contents
Methods you’d expect for Ajax-fied
POSTs are there as well:
$.get(url, callback) $.post(url, callback) $.getJSON(url, callback)
Installing and using
Thomas recommends not linking to zepto.js directly in your document
<head>, rather copy and paste the contents of zepto.min.js directly into a
Have comments? Send a tweet to @TheChangelog on Twitter.
Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.