jQuery 1.4.3 brings HTML5 data support

As of jQuery 1.4.3 HTML5 data- attributes will automatically be pulled into jQuery’s data object. For example, an HTML snippet with data- attributes – <a href=”#” data-fadespeed=”1000″ data-hidden=”true” data-targets=”['one', 'two', 'four']“>Test</a> The attributes can be directly accessed using the .data() method, like so: $(‘a’).data(‘fadespeed’) === 1000; $(‘a’).data(‘hidden’) === true; $(‘a’).data(‘targets’)[2] === ‘four’ Note that strings [...]

Posted on October 18, 2010 at 9:01 am by John Strickler · Permalink · Comments Closed
In: HTML, jQuery · Tagged with: , ,

HTML5 – localStorage

HTML5 introduces a new technique for storing precious data locally on the client, window.localStorage.  It’s part of the HTML5 specification and is already widely supported in most browsers (even Internet Explorer!). Keep in mind that data being stored on the client is potentially exposed.  You wouldn’t want to store anyone’s credit card information, social security [...]

Posted on September 28, 2010 at 9:32 am by John Strickler · Permalink · Comments Closed
In: HTML, JavaScript · Tagged with: , , ,