<script> $("input[id^='delete']").live('click', function(){ var name = $(this).attr("name"); var _this = $(this); var value = ''; if(name=='delavatar'){ value = $(this).prev().attr("src"); }else{ value = $(this).parent('td').prev().text().trim(); } if(!value){ alert('这个没有绑定!'); die(); } if(!confirm("确定删除?")){ die(); } $.ajax({ url: "&name="+name, type: "get", data:{}, dataType: "json", error: function(){ alert('Error loading XML document'); }, success: function(data){ if(data["error"] == 0){ alert(data["message"]); if(name=='delavatar'){ _this.prev().attr("src",'member/nophoto.gif'); }else{ _this.parent('td').prev().empty() } }else{ alert(data["message"]); } } })}); </script>
οnclick="open_list(this)"function open_list(obj) { window.top.$("#current_pos_attr").html($(obj).html()); }
$("input[id^=\'list2\']").live(\'click\', function(){ var checked=$(this).is(\':checked\'); $(this).parent().parent().find("input[type=\'checkbox\']").each(function(){ $(this).attr(\'checked\',false); }); if(checked){ $(this).attr(\'checked\',true); }else{ $(this).attr(\'checked\',false); } });