<head>
<script>
$(document).ready(function(){
var test=function(){
var global=Math.random();
var uid=1;
function data(){
this.ex=global+uid++;
}
var pri=new data();
var user=new data();
return function (a,b,c){
if(c!=undefined){
a[user.ex]=a[user.ex]||{};
a[user.ex][b]=c;
}else{
return a[user.ex][b];
}
}
}();
var wwb=document.getElementById("123");
var hua=document.getElementById("234");
test(wwb,"name","wangwenbo");
test(wwb,"name1","wangwenbo1");
test(wwb,"name2","wangwenbo2");
test(hua,"name","hualing");
test(hua,"name1","hualing1");
test(hua,"name2","hualing2");
console.log($(wwb));
console.log(test(wwb,"name1"));
console.log(test(hua,"name2"));
});
</script>
</head>
<body>
<p id="123">如果你点我,我就会消失。</p>
<p id="234">继续点我!</p>
<p id="456">接着点我!</p>
</body>
打开App,阅读手记