$.ajax({
url: "/business/findpersons.json",
dataType: "json",
type:"GET",
success: function(doc) {
var objs=eval(doc);
for (var i = 0; i "+
"
"+name+"
"+
"
"+password+"
"+
"
"+email+"
"+
"
"+position+"
"+
"
"+
"
"+
""
);
var getA = "#personList .deletePersonBut[name="+ i + "]";//就这里获取的原因,那个i=objs.length的原因,感觉应该就是闭包的问题。
$(getA).click(function(){
var thid=$(this).parent();
var pid=thid.children(".deletePersonBut").attr('name');
alert(objs[pid].personId);
});
var getA = "#personList .updataPersonBut[name="+ i + "]";//就这里获取的原因,那个i=objs.length的原因,感觉应该就是闭包的问题。
$(getA).click(function(){
var thid=$(this).parent();
var pid=thid.children(".updataPersonBut").attr('name');
alert(objs[pid].personId);
});
}
}
});