i am trying this one
$data = ajax(url,data,type);
Read more here: https://stackoverflow.com/questions/66994835/want-to-return-data-from-ajax-success-when-ajax-is-calling-with-in-a-function
This content was originally published by Bilal Waheed at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.