getAnnotationImageSrc: function (mark) {
var json = JSON.stringify(mark.toJSON());
function CreateMessage(callback) {
return $.ajax
({
url: Constants.Url_Base + 'Message/CreateMessage',
data:{jsData: json},
type: 'post'
})
.done(callback)
}
CreateMessage(function (resp)
{
if (resp.status !== 'ok')
{
ErrorHandler.addErrors(resp.message, css.warningErrorClass, css.warningErrorClassTag, css.inputErrorClass, '');
}
else
{
var messageId = encodeURIComponent(resp.result);
json = messageId;
src = Constants.Url_Base + "Message/GetMessage?jsData=" + encodeURIComponent(json);
}
});
}
My callback method not waiting for ajax response to be completed.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Sachin SinghRank #66 · 26.2K reputationPosted Oct 17, 2020, 3:59 AM EDT