Many features of JavaScript/DOM frameworks are being incorporated into the browser natively. In my last post, I talked about the Selectors API. In this one, we’ll look at classList. classList makes it much easier to work with elements and class names. With it, you can: Add, remove, and toggle classes; Retrieve the class name at [...]
[15 Aug 2011]
DOM Scripting is sometimes clunky. Consider the retrieval of elements with a particular class name. The code might look like this: var p = document.getElementsByTagName(‘p’); var newsitems = []; var i; for(i = 0; i < p.length; i++){ if( p[i].className == ‘newsitem’ ){ newsitems.push( p[i] ); } } In the example above, we’ve retrieved all [...]
[12 Aug 2011]
Posted for posterity (or at least until these links rot), a list of links and books to get you started. This list isn’t exhaustive by any stretch. Have any other resources to share? Post in the comments. Eloquent JavaScript JavaScript from the Mozilla Developer Center Microsoft’s Scripting Guide for Internet Explorer WebKit DOM Reference Opera [...]
[7 Apr 2011]
UPDATE: Thanks to zcorpan’s comments, I have posted a follow-up entry that should clarify the current status of the video element and its properties. I have been playing around with the HTML5 video interface lately, trying to understand what can be done with it, and how each browser supports its features as set forth in [...]
[5 Jul 2010]
I’ve been tinkering with the HTML5 video element quite a bit lately. However, it’s not the best-documented thing in the world. There are very useful properties in the video element’s events that aren’t so clearly explained in the spec. Developing a media player means you have to uncover these properties using a little bit of [...]
[29 Jun 2010]
Web applications should have the ability to manipulate as wide as possible a range of user input, including files that a user may wish to upload to a remote server or manipulate inside a rich web application. This specification defines the basic representations for files, lists of files, errors raised by access to files, and [...]
[10 Dec 2009]
Not recommended for validating URLs, but it will find them. The g flag is JavaScript specific and indicates that the matching should be global. /http:\/\/[\-\.\/\w]{1,256}(|\/)/gi
[25 Nov 2009]
SitePoint’s Kevin Yank brings us some serious criticism of Google Closure from Dmitry Baranovskiy, creator of the Raphaël and gRaphaël JavaScript libraries. From the post: Having delivered a talk on how to write your own JavaScript library (detailed notes) at the conference, Dmitry shared his thoughts on the new library over breakfast the next morning. [...]
[12 Nov 2009]
From the Google Code Blog: Closure Compiler, Closure Library, Closure Templates, and Closure Inspector all started as 20% projects and hundreds of Googlers have contributed thousands of patches. Today, each Closure Tool has grown to be a key part of the JavaScript infrastructure behind web apps at Google. That’s why we’re particularly excited (and humbled) [...]
[6 Nov 2009]