需要將以下jquery放到循環中
$(document).ready(function(){ get_total echo $rs['buy_id'];?>(); }); function get_total echo $rs['buy_id'];?>(){ $(#data_total echo $rs['buy_id'];?>).load(get_total?id= echo $rs['buy_id'];?>); }
因為為了獲取 $rs['buy_id']
想請問如何讓它不需要放在while也能獲取每個 $rs['buy_id'] 的方法?
回复内容: 我因為某些需求
需要將以下jquery放到循環中
$(document).ready(function(){ get_total echo $rs['buy_id'];?>(); }); function get_total echo $rs['buy_id'];?>(){ $(#data_total echo $rs['buy_id'];?>).load(get_total?id= echo $rs['buy_id'];?>); }
因為為了獲取 $rs['buy_id']
想請問如何讓它不需要放在while也能獲取每個 $rs['buy_id'] 的方法?
//对这些元素都加一个class 属性 class=get_total$(function(){ $(.get_total).each(function(i){ var thatid= i.attr('id'); i.load('get_total?id='+thatid); });});
