This page has two JavaScript files, script.js
and
data.js
.
script.js
is the main code file, and it would like to import
data.js
.
index.html
file include only
script.js
and include type="module"
attribute
in the script
tag of the head
section.data.js
needs to export whatever other script files will
need. Examples
MDN Web Docs: export
script.js
will import whatever it needs from
data.js
. Examples
MDN Web Docs: import
npx http-server
from the directory your HTML file is in, to
start a basic HTTP server.index.html
otherwise add the html file name to the end of
the URL.
The following data was read from a module by the script file: