jquery_metadata

Quietly extract JSON metadata contained within DOM elements.

Usage no npm install needed!

<script type="module">
  import jqueryMetadata from 'https://cdn.skypack.dev/jquery_metadata';
</script>

README

jQuery Metadata Plugin

By John Resig

This plugin is capable of silently, and automatically, extracting metadata from classes, random attributes, and child elements.

For example, you can do:

  • ...
  • OR
  • ...
  • OR
  • ...
  • 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.

    There's also a bunch of options (like loading data into a single property and the ability to ignore braces {}).