After $.post in .done() how do I use $(this)?
I am want this function to update text in a div on its completion of an
ajax $.post call. Everything works just fine except that in the .done call
$(this) is no longer looking at the element that it was listing to.
Any help would be appreciated.
//Add or Remove time from Time Off
$(".timeChange").on("click", function(){
var id = $(this).val();
var timeCommand = $(this).attr("data-command");
var currentTime = $(this).siblings('.timeHold').text();
$.post("humanResourceFunctions.php/",
{
command : "modifyLeaveTime",
employee : id,
addSubtract : timeCommand,
time : currentTime
}).done(function(data) {
$(this).siblings('.timeHold').text(data);
});
});
The problem is in the the last operation,
$(this).siblings('.timeHold').text(data);
Thank you in advance.
Talend Developer Training| Talend Developer Online ...
ReplyDeletewww.21cssindia.com/courses/talend-online-training-160.html
Talend Developer Training, Talend Developer Online Training , Talend Developer corporate Training, Best Talend Developer Training , Expert Talend ...+919000444287
Talend Developer Training| Talend Developer Online ...
ReplyDeletewww.21cssindia.com/courses/talend-online-training-160.html
Talend Developer Training, Talend Developer Online Training , Talend Developer corporate Training, Best Talend Developer Training , Expert Talend ...+919000444287