Forrester's Total Economic Impact of Freshservice on IT Service Management Download Report
+1 (866) 832-3090
+91 (44) 6667 8040
+44 (800) 808 5790
+61 2 8188 4692
You should assign “this” context to a variable, and use the variable within the callback function as shown in the below example:
var that = this;
this.$db.get("ticket:101")
.done(function(data)
{
jQuery(that.$container).find('#id').text('Success');
})
.fail(function(error_data)
console.log(error_data)
});
Lavanya.subramanian_old
You should assign “this” context to a variable, and use the variable within the callback function as shown in the below example:
var that = this;
this.$db.get("ticket:101")
.done(function(data)
{
jQuery(that.$container).find('#id').text('Success');
})
.fail(function(error_data)
{
console.log(error_data)
});