catalog
- folder
- index.html
- index.js
- index1.js
index.html
<!-- main content --->
<script type='module' src='./index.js'></script>
index.js
import {show} from "./index1"
show();
index1.js
export default function show(){
console.log('hello world');
}
descripttion
when run index.html on browser, is don't work, and i got this error:
Access to script at 'file:///Users/xxx/Documents/code/canvas/test/index.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
it may work with server, how to make it work without server, moulti-module.
import a module from other. just like run with nodejs env.