i have this function and when i use alert it gives me required data but i want to use this data inside other function and when i call this function inside that function using console.log i get undefined
function huuu() {
var siteoriginn ='https://xttttz.com/';
jQuery.ajax({
url: siteoriginn + "datafile.php,
method: "GET",
dataType: "json",
success: function(e) {
! function(e, t) {
try {
sessionStorage.setItem(e, t)
} catch (e) {
return
}
}
// it alerts the data in json format but i want to call this data in other function
// alert(JSON.stringify(e));
JSON.stringify(e);
}
})
}
i call this inside another function with
console.log(huuu());
which gives undefined. what mistake i am doing ??
any help will be great