工作记录

简单的metadata.js应用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  

<html xmlns="http://www.w3.org/1999/xhtml">  

<head>  

<title>metadata.js test</title>

<script type="text/javascript" src="jquery.js" language="javascript"></script>

<script type="text/javascript" src="jquery.metadata.js" language="javascript"></script>

<script>

$(function(){

 var metadata1=$(".media").metadata().src;

 alert(metadata1);

 alert($(".someclass").metadata().some);

})

</script>

</head>

<body>

<OBJECT class="media {src:test.mp3'}" data="[object Object]"></OBJECT>  

<li class="someclass {some: 'data'} anotherclass">aaaaaaaaaaa</li>  

<li data="{some:'random', json: 'data'}">111111111</li>    

<li><script type="data">{some:"json",data:true}</script> 22222222222222</li>  

</body>

</html>