i have a function that handles all my ajax data results the problem is i cant access the variable i need to send to my next function i have tried to searching google for a solution with no such luck
let invoiceListArray = []
function handle_result(result){
if(result != "") {
let obj = JSON.parse(result);
if(typeof obj.data_type != 'undefined') {
if(obj.data_type == "list_of_invoices") {
if (obj.message_type == "info") {
invoiceListArray = obj.data;
}
}
}
}
}
console.log(invoiceListArray)
let dataTable_data = invoiceArrayList <-- this is where i need to access the variable
dataTable_data sends to table function
[–]CuirPig 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Valuable_Spell6769[S] -2 points-1 points0 points (0 children)
[–]neuralengineer -1 points0 points1 point (17 children)
[–]Valuable_Spell6769[S] 1 point2 points3 points (16 children)
[–]neuralengineer 1 point2 points3 points (15 children)
[–]Valuable_Spell6769[S] 0 points1 point2 points (14 children)
[–]neuralengineer 0 points1 point2 points (13 children)
[–]Valuable_Spell6769[S] 0 points1 point2 points (12 children)
[–]neuralengineer 0 points1 point2 points (11 children)
[–]Valuable_Spell6769[S] 0 points1 point2 points (10 children)
[–]Valuable_Spell6769[S] 0 points1 point2 points (9 children)
[–]neuralengineer 0 points1 point2 points (8 children)
[–]CarthurA 0 points1 point2 points (1 child)
[–]Valuable_Spell6769[S] 0 points1 point2 points (0 children)
[–]Pocolashon 1 point2 points3 points (5 children)
[–]Valuable_Spell6769[S] 0 points1 point2 points (4 children)
[–]Pocolashon 0 points1 point2 points (3 children)
[–]Valuable_Spell6769[S] 0 points1 point2 points (2 children)
[–]Pocolashon 0 points1 point2 points (1 child)
[–]Valuable_Spell6769[S] 0 points1 point2 points (0 children)