首先
new是一个保留字。您需要重命名该变量。
要回答您的问题,是的,您需要保存
this在成功回调之外的变量中,并在成功处理程序代码中引用它:
var that = this;$.ajax({ // ... success: function(resp) { if(resp == 1) { $(that).siblings('.old').html($new); } }})这称为关闭。

首先
new是一个保留字。您需要重命名该变量。
要回答您的问题,是的,您需要保存
this在成功回调之外的变量中,并在成功处理程序代码中引用它:
var that = this;$.ajax({ // ... success: function(resp) { if(resp == 1) { $(that).siblings('.old').html($new); } }})这称为关闭。