【发布时间】:2016-02-04 08:15:35
【问题描述】:
如何在循环中做这样的事情? 还是有更好的方法?
$('#btndelete' + rowid[i]).click(function(){
$.ajax({
type: "POST",
url: "delete.php?id=rowid[i]",
success: function(a) {
$('#div-content').html(a);
}
});
});
【问题讨论】:
-
@Daan,一天结束,它们只附加在循环中;)
-
使用
class selector/any selector将返回集合。 -
你不能把所有的 rowid 值保存在一个变量中(可能是 b 数组)n 在控制器端传递
标签: javascript php arrays function loops