The plugins site is currently in development.
We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.
Metadata
This plugin is capable of extracting metadata from classes, random attributes, child elements and HTML5 data-* attributes.
For example, you can do:
<li class="someclass {some: 'data'} anotherclass">...</li>
OR
<li data="{some:'random', json: 'data'}">...</li>
OR
<li><script type="data">{some:"json",data:true}</script> ...</li>
OR
<li data-some="'random'" data-json="'data'">...</li>The default is the first method, but you can always change it by twiddling the options. This means that there is at least one option here that can appease you.
After that you can simply do:
var data = $('li.someclass').metadata();
if ( data.some && data.some == 'data' )
alert('It Worked!');There's also a bunch of options (like the ability to ignore braces {}).
For full documentation see http://docs.jquery.com/Plugins/Metadata.
