lib-jquery-plugin-charts-lib-metadata-jquery.metadata.js / js
Sets the type of metadata to use. Metadata is encoded in JSON, and each property in the JSON will become a property of the element itself. There are three supported types of metadata storage: attr: Inside an attribute. The name parameter indicates *which* attribute. class: Inside the class attribute, wrapped in curly braces: { } elem: Inside a child element (e.g. a script tag). The name parameter indicates *which* element. The metadata for an element is loaded the first time the element is accessed via jQuery. As a result, you can define the metadata type, use expr to load the metadata into the elements matched by expr, then redefine the metadata type and run another expr for other elements. @name .metadata.setType("class") @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" @desc Reads metadata from the class attribute @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p> @before .metadata.setType("elem", "script") @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" @desc Reads metadata from a nested script element
parameter: String type The encoding type
parameter: String name The name of the attribute to be used to get metadata (optional) @cat Plugins/Metadata @descr Sets the type of encoding to be used when loading metadata for the first time @type undefined
see: metadata()
Returns the metadata object for the first member of the jQuery object. @name metadata @descr Returns element's metadata object
parameter: Object opts An object contianing settings to override the defaults @type jQuery @cat Plugins/Metadata
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.