devwiki:javascript

This is an old revision of the document!


Javascript Advance and Modules

  • as javascript program becomes complex, it has new concepts of modules, (like python module, a library of functions)
  • as javascript is inside different browser, means it needs browser support, modern new browser has support new feature of js, but js need to tell them, how modern this JS code is, like type attribute.
    <!doctype html>
    <script type="module">
      // note: module need browser access via http, not file:///
      import {sayHi} from './say.js';
      document.body.innerHTML = sayHi('John');
    </script>

Useful code

  • devwiki/javascript.1630255903.txt.gz
  • Last modified: 2021/08/29 16:51
  • by ying