DE - Führe einfach die Funktionen von async
geladenen JavaScript Dateien aus
EN - Just execute the functions of async
loaded JavaScript files
<!doctype html>
<html lang="en">
<head>
<title>SimpleAsyncLoaderJS</title>
<script src="SimpleAsyncLoaderJS.js" async></script>
<script src="my-script.js" async></script>
</head>
<body>
</body>
</html>
if (typeof asyncFunctions === "undefined") {
var asyncFunctions = [];
}
asyncFunctions.push(function() {
console.log('called')
});
function dataScriptFunction() {
console.log('example-data-script called', document.getElementById('element'));
}
<script src="data-script-function.js" async data-script-function="dataScriptFunction"></script>
- Install
agentur1601com/file-lazy-loader
$ composer require agentur1601com/file-lazy-loader
-
Go to Themes -> Page layout -> FileLazyLoader - JS
-
Load your JavaScript files
async
@Author: Lukas Beck
@Email: [email protected]
@Link: https://github.com/LBeckX
@Copyright 1601.communication gmbh
@Link: https://www.1601.com
@Link: https://github.com/1601com
@Support: [email protected]