function getValue(id) {
var params = {
id: id
};
$.ajax({
type: "POST",
url: "url",
data: params
})
.done(function (data) {
return data;
});
}
x = getValue(1);
console.log(x); // выводит undefined
(
hndlr = function handler()
{
succfun = function succ() {
succ.flag = "всё хорошо";
return succ.flag
};
if(!flag)var flag="privet diatel";
$.ajax({
'url': "http://blablahost/blabla.blab",
'success':succfun(),
'type': "GET",
'dataType': "json",
'data': {congr:"Hi User!"}
})
console.log(succfun.flag)
},
setInterval(
hndlr,2000
)
)