It seems almost as if you're confusing Java with JavaScript. Generally, to include an external JavaScript libary, you'd do something along these lines:
At first glance, there is an obvious difference:
script tag allows you to link to an .js file, but it will bring in the entire file, where import allows you to import a subset of functions from a package.
That's understandable. JavaScript 2.0 (as far as I'm concerned) isn't really implemented at all yet. Though, it perhaps will be sometime in the future. As for now, I don't see much of a problem using the standard notation for including external JavaScript.
This becomes a problem when you have many .js files, and you don't want to copy and paste.
On one hand, you can have multiple script tags (so you can link to multiple .js files), on the other hand, when there is a naming comflict, there is no way to resolve it.
Now copy and paste comes to rescue, and you end up with multiple copies of one piece of logic being spreaded everywhere.
Bookmarks