对于html有for循环,想要单独对某一个进行ajax局部刷新
方法
在html的for中,,对每一条单独给一个变量id
<button id="{{ i.SiteLabel }}" onclick="Up('{{ i.SiteLabel }}','{{ SiteName }}','{{ SiteIP }}')" type="button">{{ n }}点赞</button>
将其id传入ajax函数中,使用字符串拼接的方法,对某个变量修改
$('#'+label).html(data+'点赞')