I can not pass the variable x
that is in return to another function.
I declare the global variable, but it still does not work.
function pegaid() {
var x = "";
_agile.get_contact("[email protected]", {
success: function (data) {
var x= data.id;
alert(x);
},
error: function (data) {
console.log("error");
}
});
alert(x);
};