heng tang
asked on
access data object in jquery ajax
hi,
if i have the following jquery function getCashBackTotalAmount() that produce the object as hilited in screenshot, how can I access the TotalCashBack value?
if i have the following jquery function getCashBackTotalAmount() that produce the object as hilited in screenshot, how can I access the TotalCashBack value?
function getCashBackTotalAmount(u_email){
console.log('cashback value');
$.ajax({
url: 'userprofile/gettotalcashback',
data : {email:u_email},
dataType: 'json',
success: function(data){
console.log('success getTotalCashBack');
console.log(data);
var $total_amt = data.TotalCashBack;
console.log($total_amt);
$('.earning > span').replaceWith($total_amt);
console.log(data.length);
},error : function(){
console.log("error getTotalCashBack");
}
});
}
screenshot.png
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.