HEX
Server: nginx/1.18.0
System: Linux m1-ws1-ams3 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /opt/aphex/sites/funkiblog.nl/wp-content/plugins/wp-optimize/js/loadAsync.js
/**
 * This function will work cross-browser for loading scripts asynchronously
 */
function loadAsync(src, callback) {
	var scriptTag,
		ready = false;

	scriptTag = document.createElement('script');
	scriptTag.type = 'text/javascript';
	scriptTag.src = src;
	scriptTag.onreadystatechange = function() {
		// console.log( this.readyState ); //uncomment this line to see which ready states are called.
		if (!ready
			&& (!this.readyState || this.readyState == 'complete')
		) {
			ready = true;
			typeof callback === 'function' && callback();
		}
	};
	scriptTag.onload = scriptTag.onreadystatechange
	
	document.getElementsByTagName("head")[0].appendChild(scriptTag)
}