Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • This works in every browser having received updates in the past two years and is much cleaner than the <script> addition hacks that were required before. To ensure that new users will learn the modern way directly, this should be the accepted answer. Commented Dec 11, 2021 at 10:44
  • 1
    If loading a file with a relative path, use ./ e.g. import('./you_path/your_file.js') Commented Apr 28, 2022 at 22:48