1前端琐碎
1.<a>链接获取属性
当JS拼接脚本需要获取a连接的属性
href="javascript:xxx(this);"和onclick="javascript:xxx(this);"
前者的this根本拿不到触发事件的A标签,而后者可以拿到
推荐写成
"<a href='javascript:openItems(" + row.itemid
+ ")'>查看</a>  " + "<a id='"+ row.itemid+"' name='"+row.itemname+"' href='javascript:void(0);' onclick='javascript:editItems(this)'>编辑</a>";
浙公网安备 33010602011771号