If you put a "data-" attribute on an element:
<div id='x' data-key='value'>
then you can get the value via the jQuery ".data()" method:
alert($('#x').data('key')); // alerts "value"
The library uses a consistent camel-case converter for attribute names with embedded dashes:
<div id='x' data-hello-world="hi">
alert($('#x').data("helloWorld"));
The camel-case converter is a jQuery "global" function:
alert($.camelCase("hello-world")); // alerts "helloWorld"
However this all breaks down when the attribute name has a name with a single letter surrounded by dashes:
<div id='x' data-image-x-offset='50px'>
alert($('#x').data('imageXOffset')); // undefined
That's a little weird, because:
alert($.camelCase('image-x-offset')); // "imageXOffset"
So what's wrong? I think it has something to do with the mechanism used to go the other direction, converting an already camel-case name back into the dashed form. I can't pinpoint it in the code however.
Seems to be the same in 1.6.2 as in 1.6.3. (The form "image-x-offset" can be used to get the data, by the way.)
edit — if, for a given element, you access via the dashed form before attempting the camel-case form, then it works (and that tells me that this is definitely a bug :-)