Need Help!
I am executing an ajax call inside a function. The result from the Ajax call is the return value of the function.
The code is as follows:
function tabstrip()
{
$.ajax({
type: "POST",
url: "/WebService/MessageUnratedCount.asmx/GetMessageUnratedCount",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
nUnratedCount=msg.d;
}
});
return nUnratedCount;
}
The nUnratedCount value should be returned after its result is obtained from the ajax call to a web service. But instead its getting returned before the execution of the ajax call. Can you please help?