From 47ae24284e7791239d3d3c3fac90407c88cd93c2 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Thu, 7 Sep 2023 15:36:30 +0300 Subject: Added params to be passed to the callback function --- src/js/arching-kaos-fetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/js/arching-kaos-fetch.js b/src/js/arching-kaos-fetch.js index bc982f9..c349081 100644 --- a/src/js/arching-kaos-fetch.js +++ b/src/js/arching-kaos-fetch.js @@ -1,4 +1,4 @@ -function archingKaosFetchJSON( url, callback ){ +function archingKaosFetchJSON( url, callback, params ){ // fetch(url, { // method:'GET', // headers:{ @@ -19,7 +19,7 @@ function archingKaosFetchJSON( url, callback ){ request.addEventListener("load", ()=>{ console.log(request.response); var json = JSON.parse(request.response); - callback(json); + callback(json, params); }); request.addEventListener("error", ()=>{ console.log("An error occured."); -- cgit v1.2.3