now we can add attributes to js files using the tools class

This commit is contained in:
asus
2024-02-27 15:23:07 +01:00
parent 7a8c0750c5
commit 2ce603e644
8 changed files with 217 additions and 107 deletions

View File

@@ -1,5 +1,7 @@
//function PLGNTLS_fetch(url, options = {}) {
/**
* this file is there for scripts that uses modules import
*/
export function PLGNTLS_fetch(url, options = {}) {
console.log("inside PLGNTLS_fetch");
url = PLGNTLS_data.fetch_url + url;
@@ -11,3 +13,10 @@ export function PLGNTLS_fetch(url, options = {}) {
return fetch(url, options);
}
/**
* For non-module scripts, attach to the global scope
*/
if (typeof window !== 'undefined') {
window.PLGNTLS_fetch = PLGNTLS_fetch;
}