**
一:json遍历对象1
**
var obj = [{ "name": "项海军", "password": "123456"}];
$.each(obj, function (n, value) {
alert(n + ' ' + value);
var trs = "";
trs += "<tr><td>" + value.name + "</td> <td>" + value.password + "</td></tr>";
tbody += trs;
});
json遍历对象2
var json = [{dd:'SB',AA:'东东',re1:123},{cccc:'dd',lk:'1qw'}];
for(var i=0,l=json.length;i<l;i++){
for(var key in json[i]){
alert(key+':'+json[i][key]);
}
}
json遍历对象3
var obj ={”name”:”冯娟”,”password”:”123456″,”department”:”技术部”,”sex”:” 女”,”old”:30};
for(var p in obj){
str = str+obj[p]+',';
return str;
}
**
二:jquery动态新增元素on click无效
**
<td>
<a class="view_qrcode">
</a>
</td>
<script>
$("body").on('click',".view_qrcode",function(){
});
</script>