日期:2014-05-16 浏览次数:20470 次
function getUsers(c){ var add = document.getElementById("add"); if (c != "null") { SearchByPetName .searchByName( c, function(data) { var size = data.length; var rs = "<ul>"; var username = '<%=username%>'; for ( var i = 0; i < size; i++) { rs += "<tr><td width = 200px align='left'>" + data[i].petname + "</td><td><input type = 'button' value = '+加关注' "+'onclick="alert(1);addAtt('+"'"+username+"','"+data[i].username+"'"+')"'+" /></td></tr> "; } rs += "</table>"; alert(rs); add.innerHTML = rs; }); } function addAtt(id1,id2) { alert("触发"); MyAttention.addAttention(id1,id2);//自己写的一个类 }