jQuery 1.7

jQuery 1.7 has been released. Most important change indefinitely is the introduction of the new .on() and .off() methods. If you’ve been using .bind() and .delegate(), transitioning to these new functions should be no problem. If you’ve been using .live(), which you shouldn’t (also see this test on jsperf), then it’s a great moment to …

HTML Component Model & the Shadow DOM

At Fronteers ’11, Alex Russel gave a great talk about the Shadow DOM (relevant slides starting from slide 32). Jake Archibald, who also gave an awesome presentation at Fronteers, provides us a nice writeup on the subject, along with a very practical example: This is an <audio> element, or at least its implementation in Google …

jQuery Mobile Select: jQuery Mobile Navigation Replacement Plugin

A often-used practice in Responsive Web Design is to replace the menu/navigation (<ul>) with a dropdown (<select>) on small devices, this to prevent it from taking up the whole screen. Today, my friend Jochen released a jQuery plugin that does the job for you automagically: jQuery Mobile Select is a jQuery Plugin to replace the …

Tangle

Tangle is a JavaScript library for creating reactive documents. Your readers can interactively explore possibilities, play with parameters, and see the document update immediately. Reminds me of something I did for a cooking site a long (long) time ago (site not available anymore), but then better. Tangle →

Demystifying jQuery 1.7′s $.Callbacks

$.Callbacks provides a way to manage lists of callbacks and it’s actually quite powerful. If we were to define two functions fn1 and fn2 we can then add these functions as callbacks to a $.Callbacks list and invoke them via the fire method. The result of this is that it becomes simple to construct complex …

Using CORS with All (Modern) Browsers

Cross-Origin Resource Sharing (CORS) works by adding a special header to responses from a server to the client. If a response contains the Access-Control-Allow-Origin header, and if the browser supports CORS, then there is a chance you can load the resource directly with Ajax – no need for a proxy or JSONP hacks. Using CORS …

jwerty: Awesome handling of keyboard events

jwerty is a JS lib which allows you to bind, fire and assert key combination strings against elements and events. It normalises the poor std api into something easy to use and clear. jwerty is a small library, weighing in at around 1.5kb bytes minified and gzipped (~3kb minified). jwerty has no dependencies, but is …