Script
↔ Code fragment run in Global Scope by Browser
aka Scripts
Scripts were precursors of Module
before ES6, Module not added - only Scripts existed, typically via IIFE wrapper
!deprecated Exporting Scripts (before ES6)
<script src="my-iife-module.js"</script\>
var myModule = (function () {
var importFunc1 = otherModule.importFunc1
var importFunc2 = otherModule.importFunc2
function myFunc() {}
function exportFunc() {
importFunc1()
importFunc2()
myFunc()
}
return {
exportFunc: exportFunc
}
})()
References
Same-Origin
↔ (policy) to block Web Page/Script to access Web Resource from different OriginuseScript()
↔ Custom Hook to Dynamically load external Script.vbs
↔ Virtual Basic Script to run VBScript to automate WinOS Processes or IE-specific tasksWeb Workers API
↔ Web API to run Script in Background Thread separate Thread of main App for better perf