Metadata 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
Metadata 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
Metadata 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 未知
开发语言
操作系统 未知
软件类型 开源软件
开源组织
地区 不详
投 递 者 不详
适用人群 未知
收录时间 2008-09-19

软件简介

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

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>

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.

展开阅读全文

评论

点击加入讨论🔥(1) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
1 评论
2 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部