Im trying to get a simple "string" from a callback function, and it remains undefined.
this is what Im trying to do:
I have an Ajax called, and its getting an "hello" messege. ->
function Func1(textConent, lineId) {
var op = "3";
var url = "../xxx/xxx.aspx";
var myReutn;
//id, lineId, place, textContent, summaryId
$.post(url, { url: url, op: op, lineId: lineId, textConent: textConent }, function (e) {
myReutn = e;
});
return myReutn;
}
then I try to fire this function with :
var e = Func1(myText, lineId);
and then alert the "e", but its remains "undefined". why is that ?